Submitting a form

Results 1 to 4 of 4

Thread: Submitting a form

  1. #1
    Join Date
    Dec 1969

    Default Submitting a form

    I wonder if someone can figure out why this form won&#039t submit. <BR>Its driving me potty!! Heres the snippet of code that validates the form. i think i have a syntax error somewhere... any advice would be apprecited!!!! <BR><BR>}<BR>function verify() <BR>{var max = window.document.quesform.elements.length;<BR> for (i=0; i&#060;max;i++) {<BR> if (window.document.quesform.elements[i].checked) return true;<BR>}<BR> if (window.document.quesform.comments.value != "") return true;<BR> return false; <BR>}<BR>//Form validation<BR>function checkForm() {<BR> if (!verify()) alert("Oops! You haven&#039t answered the questions yet.");<BR>}<BR>else <BR>{<BR>document.quesform.submit();<BR>}

  2. #2
    Dan Evans Guest

    Default RE: Submitting a form

    I can&#039t see anything that would stop it (but then again, it IS monday morning). Try littering the code with alerts to see exactly where the code is getting to and what values are held in the variables.<BR><BR>Hope this helps a little,<BR><BR>-Dan Evans

  3. #3
    Join Date
    Dec 1969

    Default RE: Submitting a form

    Maybe you use a button named "submit". Try to give it another name.

  4. #4
    Chad LaFarge Guest

    Default RE: Submitting a form

    I try to use placeholders for return values in validation scripts... easier to know what&#039s happening for me:<BR><BR>function verify() <BR>{<BR> var isValid = false;<BR> var max = window.document.quesform.elements.length; <BR> for (i=0; i&#060;max;i++)<BR> { <BR> if (window.document.quesform.elements[i].checked)<BR> isValid = true; <BR> } <BR> if (window.document.quesform.comments.value != "")<BR> isValid = true; <BR> return(isValid); <BR> }<BR><BR>In this case, either field having a value returns true.

Posting Permissions

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