|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Javascript looping through dynamic forms
Please can someone help out with this? To reiterate, I am looking for a script that will accept an ASP variable for the number of text items on in the form (as this is done dynamically). Then I wish to total the elements (be it 5 or 50) and alert if it is over a specific total, say 100.
It would be something like...Onsubmit the following function would fire: Loop through all form elements (there will only be text boxes called text<%=n%>) If form.elements.total > 50 Alert ("you have exceeded your limit, please amend your data") Hope that helps Thanks |
|
#2
|
|||
|
|||
|
ASP sample after onsubmit returns you to the same form
For x = 1 to Request.Form("Catalogid").Count
If val(Request.Form("qty_Ordered")(x)) > 0 then Mfound = true end if next You can add up your fields values and then when your html redisplays you could show a message that your over 100? Hope this help! Bob@lyrex.com |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Javascript looping through dynamic forms |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|