ID Instead of Name in jQuery
Moderator: General Moderators
ID Instead of Name in jQuery
Hi All,
Is it possible to use the id attribute of an element instead of name attribute while defining a validation rule in jQuery?
If yes, What would I have to do? I hope , you guys have some view on it.
Is it possible to use the id attribute of an element instead of name attribute while defining a validation rule in jQuery?
If yes, What would I have to do? I hope , you guys have some view on it.
Re: ID Instead of Name in jQuery
Code: Select all
$("#element_id").blah
Re: ID Instead of Name in jQuery
Thanks astions for the quick response.
Can I do the validation by using ID instead of Name attribute in jQuery?
Can I do the validation by using ID instead of Name attribute in jQuery?
Re: ID Instead of Name in jQuery
Form validation? Yes
Re: ID Instead of Name in jQuery
Can you please give some idea on this?
I think I have to change somewhere in jquery validate plugin file. right?
I think I have to change somewhere in jquery validate plugin file. right?
Re: ID Instead of Name in jQuery
Have a look at the manual. From what I see it already does use the element ID's.
http://docs.jquery.com/Plugins/Validation
http://docs.jquery.com/Plugins/Validation
Re: ID Instead of Name in jQuery
I have gone through the manual and used validation in some of the projects. jQuery use Name instead of ID for validation.
But in one form , I have the feature of Add More, Which increments the ID attribute dynamically but the name attribute is same.
The reason for making name attribute same is to get the posted value in an array.
But here the validation rule is failed.
I tried a lots of way to do it.
But in one form , I have the feature of Add More, Which increments the ID attribute dynamically but the name attribute is same.
The reason for making name attribute same is to get the posted value in an array.
But here the validation rule is failed.
I tried a lots of way to do it.
Re: ID Instead of Name in jQuery
Yeah I don't know what to tell you. I wouldn't be able to answer that without studying the documentation. From what I did see however, it was using the ID. Maybe someone else can help.
Re: ID Instead of Name in jQuery
Anyway, thanks for your comments.
