Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

jQuery Validation not working...

Featured Replies

Hi, need a little help with the jQuery validation plugin, I have read throught the docs, and have done similar to what has been asked but my email form does not seem to validate.

 

HTML

<form method="post" id="c_form" action="mail.php">
               <div class="c_table">
               	<div class="row">
                   	<div class="r_rows" id="r_name"><label>Your Name</label></div>
                       <div class="r_rows" id="r_name_box">
                           <input class="c_input required" id="c_name" name="name" type="text"  />
                           <label for="c_name" class="error"></label>
                       </div>
                   </div>
                   <div class="row">
                   	<div class="r_rows" id="r_email"><label>Your Email</label></div>
                       <div class="r_rows" id="r_email_box">
                           <input class="c_input" name="email" id="c_email" type="text" />
                           <label for="c_email" class="error"></label>
                       </div>
                   </div>
                   <div class="m_row">
                   	<div class="r_rows" id="r_message"><label>Your Message</label></div>
                       <div class="r_rows" id="r_messagebox">
                           <textarea id="c_message" name="message"></textarea>
                           <label for="c_message" class="error"></label>
                       </div>
                   </div>
               </div>
               <input type="submit" id="send" name="send" value=""  />
             </form>

 

jQuery

 

$(document).ready(function() {

   $("#c_form").validate({

	   rules:{
		   c_name: "required",
		   c_email: "required"
                          c_message: "required"
	   },

	   messages:{
		    c_name: "Required",
		    c_email: "Required",
                           c_message: "Required"
	   },


 submitHandler: function(form) {
   form.submit();
 }


}); 

});

  • Author

I believe it targets by name, not ID, so remove the c_ bits and see if that works.

 

Cheers, for some reason I tried that before, but it wasn't even working then.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.