JAVASCRIPT PROBLEM

Results 1 to 2 of 2

Thread: JAVASCRIPT PROBLEM

  1. #1
    Manpreet Guest

    Default JAVASCRIPT PROBLEM

    i am facing a problem which is like this. <BR>I have 2 drop down menus and the first (selected) values says "Select te university" and "select a course". <BR>So if the guy selectes the first feild he lands up submitting the form with an incorrect value. <BR><BR>Now i wrote the following script for this: <BR><BR>function checkval(){ <BR><BR>var univ = combiform.univ.options[combiform.univ.selectedIndex].value; <BR>var ct = combiform.course_type.options[combiform.course_type.selectedIndex].value; <BR>if (univ=="" &#124&#124 ct=="") <BR>{ <BR>alert(&#039Kindly select a correct combination.&#039); <BR>return false; <BR>} <BR>else <BR>{ <BR>return true; <BR>} <BR>} <BR>where "combiform" is the name of the form and the option value for the first value of the 2 drop downs is - "" <BR><BR>The function is called - "onSubmit" of the form. <BR><BR>NOW TO THE PROBLEM: <BR><BR>THE THING WORKS FINE IN IE4/5 BUT NETSCAPE GIVES THE FOLLOWING ERROR: <BR><BR>"combiform not defined" <BR><BR>can anybody figure out the problem.

  2. #2
    Sam Fawaz Guest

    Default RE: JAVASCRIPT PROBLEM

    I think that your problem is that you got to put document before the name of your form.<BR>Ex.: var univ = document.combiformuniv.options[combiform.univ.selectedIndex].value;<BR><BR>Your form is part of the current document. That&#039s why you cannot omit it.<BR><BR>Hope this help.<BR><BR>Sam.

Posting Permissions

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