$ is not defined [duplicate]
WP loads jQuery in no conflict mode, so you can either swap $() for jQuery(), or wrap it in a function, e.g. (function($) { // Code using `$` … })(jQuery);
WP loads jQuery in no conflict mode, so you can either swap $() for jQuery(), or wrap it in a function, e.g. (function($) { // Code using `$` … })(jQuery);
How do I add a 5 digit ZIP code validation to a Contact7 form?
Making custom meta box required (with error message if not filled in) on Gutenberg
if your above Javascript is working fine and you want to insert that into a page. Kindly add the following code to your functions.php. I have tested this code it’s working fine. function handle_comment_error() { ?> <script> document.getElementById(“comment-error”).innerHTML = “Please enter your comment.”; </script> <?php }add_action(‘wp_head’, ‘handle_comment_error’); Let me know if you face any issues.
Solved! Just add the vaidation in PHP and simply ECHO error messages: function smail(){ $nome = $_REQUEST[‘nome’]; $cognome = $_REQUEST[‘cognome’]; $email = $_REQUEST[’email’]; $telefono = $_REQUEST[‘telefono’]; $numero = $_REQUEST[‘numero’]; $messaggio= $_REQUEST[‘messaggio’]; $prod_mail = $_REQUEST[‘prod_mail’]; $prodotto = $_REQUEST[‘prodotto’]; $confezione = $_REQUEST[‘confezione’]; $prezzo = $_REQUEST[‘prezzo’]; if($nome === ”) { $nome = “<span style=”color:#8c8c8c;”>Nome non inserito</span>”; }; if($cognome … Read more
How to validate image with specific height and width selection in media selector
Code for front end validation for forms not working
validation email signup form buddypress
How to add custom regex validation to WPForms password field
I solved my problem add_filter(‘wpcf7_validate_text’, ‘or_input_validation_filter’, 20, 2); function or_input_validation_filter($result, $tag) { if (‘your-link’ == $tag->name) { $your_link = isset($_POST[‘your-link’]) ? trim($_POST[‘your-link’]) : ”; $your_file = (!empty($_FILES[“file-image”][“name”])) ? trim($_FILES[‘file-image’][‘name’]) : ”; if($your_link == ” && $your_file == ”) { $result->invalidate($tag, “One of the fields has not been completed?”); } } return $result; }