Comment

Adam

Hmm, what's with all the Javascript needed to solve this problem?
======================================
If you are using PHP/ASP etc.. why not just do this...

Firstly, I assume the problem is caused because the Value you want to POST isn't the same Value that appears in the button....

Just use some CSS and a clever bit of parsing when you check $_POST["action"]

HTML CODE:
-------------------------
(Basically we put the real value we want to pass inside brackets within the SPAN)

<button name="action" value="Cancel"><span class='button_ie_fix'>(Cancel)</span>Cancel Operation</button>

CSS:
------------------------
(Now we hide that DIV so nobody can see it)

button span.button_ie_fix{
display:none;
}

PHP/ASP/PERL (Whatever)
-----------------------
Just check $_POST["action"] for <SPAN class='button_ie_fix'>(Cancel)</SPAN> and parse out the (value) in the middle...

Something like...

eregi("<SPAN class='button_hiddenvalue'>\(([^\)]*)\)</SPAN>",$_POST["action"],$n);

if($n[1]){
$_POST["action"] = $n[1];
}

====================================
At least that way you have something that works without Javascript.. because if Javascript is turned off, you're form won't work....

You might want to set the button up differently so that text only browsers will still make sense of it...

<button name="toolid" value="34442">Big Tool <span class='button_ie_fix'>[34442]</span></button>

With that you just parse out the value inside [ ] plus it looks neat.