F
flagman5
Hi All
I have this simple code,
<SCRIPT TYPE="text/javascript">
<!--
function validateOnSubmit() {
valid = true;
if(document.pollname.question.value == "")
{
document.getElementById('in_question').innerHTML = 'Required!
Please put something';
valid = false;
}
return valid;
};
//-->
</script>
to check the input fields, make sure they are not empty. and if empty,
simply change a field next to it to a different text. the HTML form
code is
<form action="member_polls.php" method = "POST" name="pollname"
onsubmit="return validateOnSubmit();">
<input type="text" name="question" size="60"><td id="in_question">
Required</td><br/><br/>
So, my problem is, the form does NOT stop processing! I dont
understand? It is suppose to return a false if the field is empty, but
when i try it out, the form continues processing. What gives?
Thanks in advance
I have this simple code,
<SCRIPT TYPE="text/javascript">
<!--
function validateOnSubmit() {
valid = true;
if(document.pollname.question.value == "")
{
document.getElementById('in_question').innerHTML = 'Required!
Please put something';
valid = false;
}
return valid;
};
//-->
</script>
to check the input fields, make sure they are not empty. and if empty,
simply change a field next to it to a different text. the HTML form
code is
<form action="member_polls.php" method = "POST" name="pollname"
onsubmit="return validateOnSubmit();">
<input type="text" name="question" size="60"><td id="in_question">
Required</td><br/><br/>
So, my problem is, the form does NOT stop processing! I dont
understand? It is suppose to return a false if the field is empty, but
when i try it out, the form continues processing. What gives?
Thanks in advance