I'm building a front end post form for car dealing. I have the "if statement validation" at the begining of my template, before get_header() function, after that i have the form. Can i have two or more forms in that template without a conflict?
1 Answer
Yes. You can check which form is being submitted by adding a "name" attribute to the submit button.
<input type="submit" name="form1" value="Submit">
Then in you validation, just check if that exists:
if(isset($_REQUEST['form1'])){
// Form 1
} elseif(isset($_REQUEST['form2'])) {
// Form 2
}
This is one method at least, there are plenty of ways to deal with it.
-
Thank you very much, James! That was exacly what i needed! Commented Mar 17, 2014 at 13:29