Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

checkbox validation problem 1

Status
Not open for further replies.

pandapark

Technical User
Jan 29, 2003
92
0
0
GB
Hi

i've got this code which works ! but its only validating 7 out of the 9 checkbox fields i have. Is there a limit on the length ?
the missing 2 fields are chkFailurePink and chkCalendar

thanks
keith

Code:
Response.Write "if (document.frmEnquiry.chkBNE.checked == false && document.frmEnquiry.chkRucking.checked == false && 
document.frmEnquiry.chkSpillage.checked == false && document.frmEnquiry.chkfailureBlack.checked == false && 
document.frmEnquiry.chkfailureGreen.checked == false && document.frmEnquiry.chkExtraGreen.checked == false && 
document.frmEnquiry.chkExtraPink.checked == false) { " & vbLf
Response.Write "    alert('You must select at least one tick box that the enquiry relates to');" & vbLf
Response.Write "    return false;" & vbLf
Response.Write "}" & vbLf
 
sorry i forgot to mention that if i add the other 2 checkboxes in it fails completely !
 
Can you show the client-side JavaScript and relevant HTML (i.e. all form and all elements)?

We have no way of knowing how much, or little, of the above client-side code is eventually delivered to the page.

Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Suggest you check for a typo (in both the HTML and the script) - remembering that Javascript is case-sensitive.

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]

What is Javascript? faq216-6094
 
yeah I've been checking for typo's for half an hour........and just found it

sorry ! i thought there was a little on javascript if statements or something !

keith

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top