|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
validation problem
hey im using javascript to validte my asp pages so am relatively new to it. does anyone know whats wrong with the following code?
im looping through 5 textboxes all called txtCommitteeMember1, txtCommitteeMember2, txtCommitteeMember3 etc. <Script language="JavaScript"> function checkval() { for (i = 0; i <= 5; i++) { if (document.form2.txtCommitteeMember[i].value.length == 0) {alert('You must enter a Member .') return false; loop } } } </Script>
__________________
lol |
|
#2
|
||||
|
||||
|
1. You're looping through 6 textboxes
2. You don't need 'loop' 3. You can't address the textboxes as an array in this manner Last edited by Yeruhn : February 24th, 2004 at 02:07 AM. |
|
#3
|
||||
|
||||
|
And for reference here are some JavaScript validation resources:
Javascript Field Validations -- Client Side Scripting by Nannette Thacker - 8/19/1999 http://www.shiningstar.net/articles...tions.asp?ID=AW Form Validation Using Javascript - 9/19/1998 http://www.4guysfromrolla.com/webtech/091998-1.shtml Good tips such as saving JavaScript functions in a file called DataValidation.js and including this in pages that need this. JavaScript functions. WebDaily: Your daily source for Web Technology Tips and Tricks! - 10/27/1998 http://www.4guysfromrolla.com/webtech/102798-1.shtml Just checks if fields filled in. Form Validation Scripts http://www.coolnerds.com/jscript/formval.htm
__________________
J. Paul Schmidt www.Bullschmidt.com - Freelance Web and Database Developer www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > validation problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|