Hi guys, I have a slight problem, I am trying to capture the input of two buttons, one yes, one no, into a database but for some reason the database doesn't always show the value of the button clicked, it just shows up blank.
<form action="refer.php" method="post" id="formID" >
<div class="prompt_container" style="float: left;">
<span class="prompt_item"><input type="image" src="images/yes.jpg"
alt="submit" value="yes" onclick="this.disabled=true,this.form.submit();"
/></span>
<input type="hidden" name="refer" value="yes">
</div>
</form>
<form action="thank_you.php" method="post" id="formID" >
<div class="prompt_container" style="float: right;">
<span class="prompt_item"><input type="image" src="images/no.jpg"
alt="submit" value="no" onclick="this.disabled=true,this.form.submit();"
/></span>
<input type="hidden" name="refer" value="no" >
</div>
</form>
Here is the code that writes it all to the database
session_start();
$name = $_SESSION['name'];
$tel = $_SESSION['tel'];
$email = $_SESSION['email'];
$refer = $_POST['refer'];
$curDate = date("Y-m-d");
mysql_connect ("host", "user", "pass") or die ('Error: ' . mysql_error());
mysql_select_db ("database");
$query = "INSERT INTO Table (id, name, tel, email, refered, date)
VALUES('NULL', '".$name."', '".$tel."', '".$email."', '".$refer."', '".$curDate."')";
mysql_query($query) or die (mysql_error());
Apparently anything lower than IE8 will ignore the value attribute of all <input type="image">
form inputs.
How could I get this to work properly in all browsers? jQuery or Javascript maybe?