Javascript...validation of select in IE and netsca

Results 1 to 2 of 2

Thread: Javascript...validation of select in IE and netsca

  1. #1
    sean Guest

    Default Javascript...validation of select in IE and netsca

    hello all,<BR>I have a script I use to check form validation before submitting to a database, works great except for one thing. In IE, the script does not detect the select pull-down as changed after I change it, i.e. no matter what i pick it tells me i haven&#039t filled it out yet. In netscape, another problem, the script pop-up window does not even detect the pull-downs named in the script and therefore does not mention them in the popup... here is the code, is there a way I can change this for the script to detect the pulldowns, and tell if they have been changed so the form will submit correctly??? thanks alot!!<BR><BR><BR>&#060;!-- Begin<BR>function checkFields() {<BR>missinginfo = "";<BR>if (document.form.FIRST_NAME.value == "") {<BR>missinginfo += "
    - First Name";<BR>}<BR><BR>if (document.form.LAST_NAME.value == "") {<BR>missinginfo += "
    - Last Name";<BR>}<BR>if (document.form.JACK.value == "") {<BR>missinginfo += "
    - Jack?";<BR>}<BR><BR>if (document.form.DATEMONTH.value == "") {<BR>missinginfo += "
    - Month?";<BR>}<BR><BR>if (document.form.DATEDAY.value == "") {<BR>missinginfo += "
    - Day?";<BR>}<BR><BR>if (document.form.DATEYEAR.value == "") {<BR>missinginfo += "
    - Year?";<BR>}<BR><BR>if (document.form.TYPEOFPC.value == "") {<BR>missinginfo += "
    - Type of computer?";<BR>}<BR><BR>if (missinginfo != "") {<BR>missinginfo ="_____________________________
    " +<BR>"You failed to correctly fill in your:
    " +<BR>missinginfo + "
    _____________________________" +<BR>"
    Please re-enter and submit again!";<BR>alert(missinginfo);<BR>return false;<BR>}<BR>else return true;<BR>}<BR>// End --&#062;<BR>&#060;/script&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Javascript...validation of select in IE and ne

    here&#039s how you get the value of a pulldown (it&#039s not just .value)<BR><BR>var pulldown = document.forms[&#039formName&#039].elements[&#039dropdown&#039]<BR>selectedValue = pulldown.options[pulldown.selectedIndex].value<BR><BR>j

Posting Permissions

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