CheckBox Javascript

Results 1 to 2 of 2

Thread: CheckBox Javascript

  1. #1
    Join Date
    Dec 1969

    Default CheckBox Javascript

    &nbsp;<BR>I have a form in which there are nine checkboxes. The user clicks on one of the checkboxes and clicks submit and it calls the next page where he can view the details of the checked item.<BR>I wanted a piece of code in javascript wherein it would check if the user has made a selection and if not then an a message will come up saying that "u have to make a selection".

  2. #2
    Join Date
    Dec 1969

    Default RE: CheckBox Javascript

    this sort of code is everywhere on the net, free for the downloading. <BR><BR>anyway. here we go - rough version<BR><BR>var arr = new Array(checkbox1, checkbox2, checkbox3) // must be full document.forms refs<BR>var error = true<BR>for(x=0;x&#060;arr.length;x++)<BR>{<BR>if( arr[x].selected==true){error=false}<BR>}<BR><BR>if(error ==true){<BR>alert(&#039error message&#039)<BR>}<BR><BR>jason

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts