Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
jQuery: how to validate an input text before submit or change the cursor?
Old 11-22-2010, 04:37 PM jQuery: how to validate an input text before submit or change the cursor?
Average Talker

Posts: 20
Name: sadssa
Trades: 0
Hi,

using jQuery, how to validate a required input text before submitting or placing the cursor in another field?

I've tried this below but it doesn't work.


Code:
$(document).ready(function() {
  $("#form").validate({
    rules: {
      name: "coche4[marca]",
      required: true
      }
    },
    messages: {
      comment: "You must insert something."
    }
  });
});
Regards
tirengarfio is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-22-2010, 05:56 PM Re: jQuery: how to validate an input text before submit or change the cursor?
Novice Talker

Posts: 11
Name: Grigoriy Sidelnikov
Location: San Francisco, CA
Trades: 0
Have you tried looking at this page?

http://docs.jquery.com/Plugins/validation

It includes source code and a demo.
__________________

Please login or register to view this content. Registration is FREE
Teaches you to make Google-safe websites and use your knowledge, your brain's inherent ability to reason, and creative-writing talent to produce great content that people will remember and want to return to over and over again.
Greg Sidelnikov is offline
Reply With Quote
View Public Profile Visit Greg Sidelnikov's homepage!
 
Old 11-24-2010, 12:36 PM Re: jQuery: how to validate an input text before submit or change the cursor?
CSM
CSM's Avatar
Front-End Developer

Posts: 297
Name: Michael Pehl
Location: Palma de Mallorca
Trades: 0
Example

Code:
$("input[type=text]").keyup(function(){
$("#form").validate({
    rules: {
      name: "coche4[marca]",
      required: true
      }
    },
    messages: {
      comment: "You must insert something."
    }
  });
});
If your input text button has an ID you can use that, too.
__________________
Chief Web Officer / Front-End Developer / System Engineer

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
CSM is offline
Reply With Quote
View Public Profile Visit CSM's homepage!
 
Reply     « Reply to jQuery: how to validate an input text before submit or change the cursor?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30719 seconds with 12 queries