Question:

Javascript syntax error

by  |  earlier

0 LIKES UnLike

What is the correct code for this verification function:

function check_form()

{

if (document.getElementById("other_option")...

{

if (document.getElementById("other_text").v... > 0) || (document.getElementById("other_text_b")... > 0)

}

return true

}

else

{

alert("You must enter the other text")

return false

}

}

return true

}

</script>

 Tags:

   Report

2 ANSWERS


  1. I want to help with this problem but some of the code is missing because of the way Yahoo! answers truncates lines.  Perhaps you could repost or send me the file as an attachment?

    JDW

    modulo_function


  2. document . getElementById ( &quot; other_text &quot; ) . value &gt; 0)

    is a wrong comparison: you compare a text to a numeric value.

    Use

    ( &quot; other_text &quot; ) . value = &quot; &quot;

    (remove the spaces: &quot;&quot;).

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.