flatword
Forum Replies Created
-
Closing the notice removed it from displaying on each page load. I assume any new notice from BetterLinks will display on each page load until this gets fixed. So until then, I will just close them.
Thank you!
Thanks for all the information.
But it’s weird in that I was going to test your suggestions and I deactivated BetterLinks and the javascript still worked without me doing anything.
So I deleted BetterLinks and it still works.
I did clear the cache and it still works.
I’m cautiously optimistic because it just doesn’t make sense.
I tried all 4 of your suggestions and here are the results.
This alert message works when BetterLinks is active but not when it is deactivated.
jQuery(document).ready(function($) { alert("Testing jQuery"); });
When I deactivate BetterLinks, the console displays this error for 3 different lines:
jmlcontractingapp/:265 Uncaught ReferenceError: jQuery is not defined
I am adding the javascript using a plugin for wordpress called WPCode.
I added this code:
wp_enqueue_script('custom-script', 'path-to-your-script.js', array('jquery'), null, true);
…and with betterlinks not activated, that line gives an error
Uncaught ReferenceError: wp_enqueue_script is not defined
…and then the other 3 errors display.
Even with betterlink active, I still get that 1 message
jmlcontractingapp/:267 Uncaught ReferenceError: wp_enqueue_script is not defined
And I disabled the speed optimization plugin but that made no difference.
- This reply was modified 6 days, 23 hours ago by flatword.
Pial,
I disabled all but the BetterLinks plugin and the message still displays at the top.
I made this loom video so you can see what I see
Let me know once you are done viewing that so I can delete it. I only have a limited number of Loom videos I can have at once.
Thank you
Forum: Plugins
In reply to: [Contact Form 7] Cannot stop submission during a JS validationHere is the most recent code that correctly displays an error for the appropriate field group, but does not prevent the submission of the form.
JS for the validation:// Add the CSS
const styleSheet = document.createElement('style');
styleSheet.textContent =<br>.field-group-error {<br> color: #ff0000;<br> font-size: 14px;<br> font-weight: bold;<br> margin: 5px 0;<br> padding: 5px;<br> display: none;<br>}<br><br>.field-group {<br> position: relative;<br>}<br><br>.field-group.has-error {<br> border-color: #ff0000 !important;<br>}<br>
;
document.head.appendChild(styleSheet);
jQuery(document).ready(function($) {
// Add error message elements at the start of each field group
$('.field-group').each(function() {
$(this).prepend('<div class="field-group-error"></div>');
});
// Function to validate a group (location or work)
function validateGroup(selectField, textField) {
return selectField.val().trim() !== '' || textField.val().trim() !== '';
}
// Function to display error for a group
function showError(group, message) {
group.addClass('has-error')
.find('.field-group-error')
.text(message)
.show();
}
// Function to clear error for a group
function clearError(group) {
group.removeClass('has-error')
.find('.field-group-error')
.hide();
}
// Function to perform validation
function validateForm() {
let isValid = true;
const form = $('.wpcf7-form');
// Validate location group
const locationGroup = form.find('[name="location-select"]').closest('.field-group');
if (!validateGroup(
locationGroup.find('[name="location-select"]'),
locationGroup.find('[name="location-typed"]')
)) {
showError(locationGroup, 'Select or enter a location!');
isValid = false;
} else {
clearError(locationGroup);
}
// Validate work group
const workGroup = form.find('[name="work-select"]').closest('.field-group');
if (!validateGroup(
workGroup.find('[name="work-select"]'),
workGroup.find('[name="work-typed"]')
)) {
showError(workGroup, 'Select or enter a work description!');
isValid = false;
} else {
clearError(workGroup);
}
// Validate file upload
const uploadGroup = form.find('[name="upload-file"]').closest('.field-group');
if (!uploadGroup.find('[name="upload-file"]')[0].files.length) {
showError(uploadGroup, 'Select a file to upload!');
isValid = false;
} else {
clearError(uploadGroup);
}
// Clear all errors before returning the validation result
if (isValid) {
$('.field-group-error').hide();
$('.field-group').removeClass('has-error');
}
return isValid;
}
// Add validation to the form submission
$(document).on('submit', '.wpcf7-form', function(e) {
if (!validateForm()) {
e.preventDefault();
e.stopPropagation();
}
});
// Real-time validation on change
// $('.wpcf7-form').on('change', 'select, textarea, input[type="file"]', function() {
// validateForm();
// });
});And here is the form definition:
[response]
<div class="field-group">
<label for="location-select">Select Location:</label>
[select location-select "" "Miami" "Orlando" "Tampa" "Jacksonville"]
<label for="location-typed">Or Type Location:</label>
[textarea location-typed rows:4]
</div>
<div class="field-group">
<label for="work-select">Select Work Done:</label>
[select work-select "" "Bathroom Remodel" "Kitchen Remodel" "Roof Repair" "Painting" "Flooring"]
<label for="work-typed">Or Type Work Done:</label>
[textarea work-typed rows:4]
</div>
<div class="field-group">
<label>Upload Picture or Video (25 MB Max):</label>
<div class="custom-upload-wrapper">
<button type="button" class="custom-upload-button">Choose File</button>
<span class="selected-file-name">No file chosen</span>
[file upload-file filetypes:.jpg|.jpeg|.png|.gif|.mp4|.mov|.avi limit:25mb class:cf7-upload-input]
</div>
</div>
[submit "Submit"]I noticed this problem is happening again and for a while now.
Anytime I refresh any page while editing (whether it is editing a page or editing the site css or anywhere in the site), the entire page refreshes as expected but before it redisplays, the message “Want to help make BetterLinks even more awesome? Be the first to get access…” displays with the buttons Sure Id LIke To Help or No Thanks. That clears after a second.
This is happening every time.
I can’t see how to attach a file here so I can’t show you the screen clip.
Thank you @rsouzaam.
I had been trying the instructions in that post for well over an hour. If you read that post, it says to refer to another post
If you need help in adding snippets to your site, please see this tutorial.
So in that post you will see
Next, you’ll see the Insertion section. Since we’re adding PHP, we’ll select Auto-Insert for the Insert Method and Frontend Only for the Location.
The problem is that you don’t see it to Frontend Only…you leave it set to its default of “Run Everywhere”.
So while that first post is great for providing the PHP code, the article which it references was not accurate.
Perhaps you can update one of these 2 posts to mention the proper snippet location to run.
Thank you again for your reply. The screencast you made give me the answer because even though you did not show the setting at the bottom of the snippet, since you didn’t set it then it was obvious it should be left as the default…which is “Run Everywhere?
- This reply was modified 2 weeks, 5 days ago by flatword.
I am integrating an Elementor button with Popup Maker.
I think the problem was I also had an anchor tag defined for the button. Once I removed that, the popup from the button worked. Thank you
- This reply was modified 3 months, 1 week ago by flatword.
Thank you for providing that link.
I have send the support ticket as you asked.
The pattern I am finding is that when I add a new Popup, it is always using the class from the previously created Popup. So I have to manually change it even though I choose the Popup in the Popup Controls dropdown box.
Hi,
This issue occurred again. I created a new Popup which was assigned css class popmake-565.
But when I chose it in the wordpress form under Popup Controls, it assigned it the css class of a different popup (it used the same class from the first ever popup I had created just like the previous problem I reported). So I had the problem where the popup would not work until the 3rd click.
As this is just the 3rd popup I have created, I have this problem for each one other than the 1st.
Yes…I did the full restore after the Better Replace breaking change.
I am still looking to find out why the mixed content the the themeisle links. Perhaps it is related to them
I recorded a video but then I noticed an update for BetterLinks to 2.0.1 so I did that and the issue has gone away. Did you knowingly put out a fix for this in that new version?
Or did you just remove the “Hey I noticed you have created xxx via betterLinks” message? Because I don’t see that message on the Dashboard anymore eithe.
Thank you for reposting that video. I forgot that the NoFollow sets the NoIndex as well.