Dear All,
I have made a button save on my script which is inside a form. I have to transfer an input value to a function but the issue is that the button must include the form input text value.
<input class="box" name="btnSave" type="button" id="btnSave" value="Save" onClick="window.location.href='<?php echo $_SERVER['PHP_SELF'] . "?action=save"; ?>';" >
Could you please help me.
Best Regards
Dilbert137
Input value and buttons
Moderator: General Moderators
-
Dilbert137
- Forum Commoner
- Posts: 57
- Joined: Sat Jun 02, 2007 5:02 am
- Location: Mauritius
-
Dilbert137
- Forum Commoner
- Posts: 57
- Joined: Sat Jun 02, 2007 5:02 am
- Location: Mauritius
You could have tried it already....just give them diferent name=""/value tag so you know the action required and should be no problem.Dilbert137 wrote:The form has already a submit input type for update task and the other task like delete, new and save is buttons. Can I make a second submit in a form? Is it possible?
Regards
Dilbert137
-
Dilbert137
- Forum Commoner
- Posts: 57
- Joined: Sat Jun 02, 2007 5:02 am
- Location: Mauritius
feyd | Please use
Best Regards
Dilbert137
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
This is my solution. Maybe it will help some new programmer with the same issue but the case must be equal the value of the submit input value .Code: Select all
<?php
if (isset($_POST['btnUpdate']))
{
$action=$_POST['btnUpdate'];
}
switch ($action)
{
case 'Update':
updateType();
break;
case 'view':
}
?>
<input class="box" name="btnUpdate" type="submit" id="btnUpdate" value="Update"/>Dilbert137
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]