I've started using the button element to submit my forms
<button type="submit">Send</button>
I know if I used an input element like so, I could easily determine in PHP which form was submitted (by reading the value of $_POST['form']
in the example below).
<input type="submit" value="Send" name="form" value="contact" />
Is there a way to do this using the button element? There will be one button element per form. I know that IE6 has problems with multiple button elements in one form, and IE7 sends the innerHTML instead of the value.
Would this be reliable?
HTML
<button type="submit" name="form-contact" value="true">Send</button>
PHP
if (isset($_POST['form-contact'])) {
// Contact Form submitted
}
Many thanks