The below 1 is image button. I want to get this button value.
But it not same with button that can get the value.
So any way can get the value from image button ?
<input name="Image1" value="Search" type="image" src="images/ql_ntu1.gif" >
get the value from image button
Moderator: General Moderators
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
or couldn't you always set an action or onclick action? =P forcing it to run a js function that will report it had been clicked? works for me...
especially with the <button> operator since you can embed images within it and completely control the way it behaves as a button instead of the common <Input type="button"> where you are limited to what you can do...
especially with the <button> operator since you can embed images within it and completely control the way it behaves as a button instead of the common <Input type="button"> where you are limited to what you can do...
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
Well, since JS is a client side langauge, there's no guarantee it will work. I think my way is the best:
Untested
You're allowed to overload $_POST values right?
Untested
Code: Select all
$form_buttonpairs['image1'] = "Search";
//Add extra values as needed
foreach($form_buttonpairs as $key => $value) {
if (isset($_POST[$key])) {
$_POST[$key] = $value;
}
}not to try and argue, but there is most definately a way for it to work.. i use it all the time 
i'm not gonna write the entire thing, but all it boils down to is doing a simple :
<button onclick=jsscript('myvaluetopass'); name="bob">
jsscript could then say document.location.replace('bob.php?value=$valuepassed')
php just does a $_GET['value'], boom bam splat, ye get what you needed...
i'm not gonna write the entire thing, but all it boils down to is doing a simple :
<button onclick=jsscript('myvaluetopass'); name="bob">
jsscript could then say document.location.replace('bob.php?value=$valuepassed')
php just does a $_GET['value'], boom bam splat, ye get what you needed...
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US