0

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 1

1

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.

1
  • Thank you very much, James! That was exacly what i needed! Commented Mar 17, 2014 at 13:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.