reub77
10-09-2002, 05:15 AM
I would like to use an image instead of an ugly submit button. Here is my code:
<!--This doesn't work-->
<form name='form$x' method='post' action='projLeads.php'> <input type='hidden' name='ID' value='$jobID'>
<input type='image' src='images/remove.gif' alt='Delete' name='Delete' width='13' height='15'>
</form>
<!--This does-->
<form name='form$x' method='post' action='projLeads.php'> <input type='hidden' name='ID' value='$jobID'>
<input type='submit' name='Delete' value='Delete'>
</form>
This is the code that processes the form:
<?PHP
if($Delete) {
$conn = db_connect();
//declare query
$query = 'DELETE FROM currProjects WHERE id="'.$ID.'"';
//execute query
$result = mysql_query($query);
//declare query
$query = 'DELETE FROM invoices WHERE id="'.$ID.'"';
//execute query
$result = mysql_query($query);
//declare query
$query = 'DELETE FROM contracts WHERE id="'.$ID.'"';
//execute query
$result = mysql_query($query);
}
?>
So the first bunch of coding is what I want to get to work. The second works. The third is just to give you a better idea as to what I'm trying to do, it works.
How can I use the image submit button to work properly as a submit button?
<!--This doesn't work-->
<form name='form$x' method='post' action='projLeads.php'> <input type='hidden' name='ID' value='$jobID'>
<input type='image' src='images/remove.gif' alt='Delete' name='Delete' width='13' height='15'>
</form>
<!--This does-->
<form name='form$x' method='post' action='projLeads.php'> <input type='hidden' name='ID' value='$jobID'>
<input type='submit' name='Delete' value='Delete'>
</form>
This is the code that processes the form:
<?PHP
if($Delete) {
$conn = db_connect();
//declare query
$query = 'DELETE FROM currProjects WHERE id="'.$ID.'"';
//execute query
$result = mysql_query($query);
//declare query
$query = 'DELETE FROM invoices WHERE id="'.$ID.'"';
//execute query
$result = mysql_query($query);
//declare query
$query = 'DELETE FROM contracts WHERE id="'.$ID.'"';
//execute query
$result = mysql_query($query);
}
?>
So the first bunch of coding is what I want to get to work. The second works. The third is just to give you a better idea as to what I'm trying to do, it works.
How can I use the image submit button to work properly as a submit button?