Error message for Unchecked Checkboxes

Results 1 to 3 of 3

Thread: Error message for Unchecked Checkboxes

  1. #1
    Join Date
    Dec 1969

    Default Error message for Unchecked Checkboxes

    I have got a page with student names and checkboxes next to each one ---the user selects the student by ticking on a check box --However I would like to add a error message in case the user forgets to tick a check box .<BR><BR>On the next page I have :<BR><BR>Student_Index = Request.form (form_element_name)<BR><BR>so would i add an if statement as follows :<BR><BR>if student_index = "" then<BR>response.write " You have to select a student"<BR>end if<BR><BR>Thanks for your help<BR>smita

  2. #2
    KPW Guest

    Default Did you try it?

    It looks to me like you have an idea of how you should go about doing this. Did you try it to see if it would work? It probably would have been faster to try it than to post here and wait for a response.<BR><BR>Anyhoo, now that I&#039m here, may I suggest that you validate the form client-side before sending it to the server? That is, when your user chooses the Submit button, iterate over the form elements, look specifically at the ones that are checkboxes, and see if at least one is checked. If so, the form is good to go; otherwise, don&#039t allow the form to be submitted.

  3. #3
    Rob Guest

    Default RE: Error message for Unchecked Checkboxes

    What you are doing seems a bit cumbersome.<BR><BR>On the page that your form is on why don&#039t you consider using some client-side javascript to inform the user before he/she leaves the page that they have indeed have not checked a student checkbox.<BR><BR>Regards,<BR>Rob

Posting Permissions

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