two submit buttoms for a form ?
Moderator: General Moderators
-
rekha_harnoor
- Forum Commoner
- Posts: 32
- Joined: Mon Feb 19, 2007 3:17 am
two submit buttoms for a form ?
Can I give two submit buttoms for a form?
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Yes, you can.
You will need to give each of them the same name, then do what you want with the form depending on the value of the submit button.
At least, that's how I do it.
You will need to give each of them the same name, then do what you want with the form depending on the value of the submit button.
Code: Select all
<input type="submit" name="submit" value="Preview" />
<input type="submit" name="submit" value="Post" />
<?php
//proccessing form
switch($_POST['submit'])
{
case 'Preview':
//process for preview
break;
case 'Post':
//process for post
break;
}
?>Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.