[jQuery] dynamic validation in a smart way
dear all,
thanks for the help so far.
i was converting some validation forms we have to the new jQuery and i
run into a problem i hope i can get some assist to solve it.
here is the situation: i have a dynamic fields that are added to the
form, i want to validate these added fields.
the scenario is as follow:
There are three input fields for the medicines by default. just the
(Geneesmiddel) in the first row is mandatory and if you filling the
Geneesmiddel field then the rest of the three fields are mandatory
(Sterkte ,Aantal, Gebruik).
i did validate the first, second and the last rows manaully. i added
also a rule for the Geneesmiddel field so if there are some new added
fields it will also validate them. my problem now is how to add the
rules for the three added fields only if new Geneesmiddel field is
added and is not empty. now it is by default mandatory even if the
Geneesmiddel field is empty.
also i would like to have some suggestion on how to improve the code
to make it something generic and not these manually hardcoded checks
for id's.
here is a link if you want to check the page:
http://www.voorbeeldvan.uwapothekeronline.nl/pages/New_Herhaalrecepten.asp?articleid=113816
any help will be very appreciated.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home