deharvy
asked on
Check If Form Element Exist in Page
Here is my form:
<form name="FormXX" method="post" action="default.htm">
<input id="idBoxOne" name="bxOne" type="text">
</form>
I know how to get the value of an input button.
var text = document.FormXX.bxOne.valu e;
How do I write an if statement to check if the form value of bxOne exist or not?
<form name="FormXX" method="post" action="default.htm">
<input id="idBoxOne" name="bxOne" type="text">
</form>
I know how to get the value of an input button.
var text = document.FormXX.bxOne.valu
How do I write an if statement to check if the form value of bxOne exist or not?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
I'm glad I could help. Thanks for the grade, the points and the fun question.
bol
bol
By the way .. that is Javascript, which is what you were using in the code you had for the example. You posted this in the PHP zone though so if you need this on the server in PHP then use ...
if (isset($_POST["bxOne"])) {
// the browser sent something for this field
} else {
// nothing was in this field
}
Let me know if you have a question.
b0lsc0tt