danglingpointers
Technical User
And now I shall reveal my truly newb-self. I have a form which I want to validate its fields before I submit it to a database. I am having some problems with my javascript.
I know the function is being called because I tested this without the "if" clause and the alert box always ran. FIELD_VALUE is the value entered in an <input type="text"> element. However, my "if" statement is returning false even when the element FIELD_VALUE is left blank.
Thanks in advance.
- Tim
Code:
function form_validate(thisform)
{
with(thisform){
if(FIELD_VALUE.equals(null)){
alert("Enter a value!");
}
return false;
}};
//elsewhere
<form method=get action=display.jsp onsubmit="return form_validate(this)">
I know the function is being called because I tested this without the "if" clause and the alert box always ran. FIELD_VALUE is the value entered in an <input type="text"> element. However, my "if" statement is returning false even when the element FIELD_VALUE is left blank.
Thanks in advance.
- Tim