aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Problem with jquery.validate.js plugin selectors Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Problem with jquery.validate.js plugin selectors" Watch "Problem with jquery.validate.js plugin selectors" New topic
Author

Problem with jquery.validate.js plugin selectors

Deepak Prasanna Ramaswamy
Greenhorn

Joined: Aug 27, 2009
Posts: 3
Hi Guys, Im trying to do a client side form validation using the jquery.validate.js plugin.
This is what i tried.



Everything works perfect!
But since im programming under rails my html gets generated in way where the input tag looks like this,

If i change the name back to name="data" my rails functionality gets affected.
So i modified the script like this


Now im getting a javascript error. How can accomplish the validation without changing the name attribute of the input tag?
Apart from name is there anyother selector for which rules and messages can be set? Any takers ?

There is only one thing which god lacks, and that is existence!!
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You need to use quotes around your element name because user[data] is saying store this in an array called user at index data.




Eric
Deepak Prasanna Ramaswamy
Greenhorn

Joined: Aug 27, 2009
Posts: 3
Thanks Eric.
It worked!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with jquery.validate.js plugin selectors
 
Similar Threads
javascript to jsp(i am sorry to post it once again please see the code i have everything ut does not
how to get input from javascript and pass to servlet
how to transfer data from javascript to jsp
jQuery Validator and select
JSP <a href> tags breaks page functionality