# IE Button Value Fix / Rant

**URL:** <https://forum.kirupa.com/t/ie-button-value-fix-rant/279979>\
**Category:** web dev\
**Created:** [January 21, 2009, 9:12am UTC](https://forum.kirupa.com/t/ie-button-value-fix-rant/279979 "2009-01-21T09:12:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phorte](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@phorte](https://forum.kirupa.com/u/phorte)\
**Post date:** [January 21, 2009, 9:12am UTC](https://forum.kirupa.com/t/ie-button-value-fix-rant/279979/1 "2009-01-21T09:12:20Z")

</div>

So ive been working on this online ordering system for the bookshop I work in, and its been going along quite well, working out php and sql etc. And ive pretty much got it working perfectly, and then i went and did the dreaded Internet Explorer test… DISASTER.

So i find out that using \<button\> tags is a big no no, cause IE is stupid and thinks that even though you set a value parmater, it will still pass the innerHTML to your POST data. shocking, I just dont understand how that could even be considered to be resonable adhereance to standards, anyway. So i went researching the \<input type=“submit”\> tags, and find that with that, you still cant have different data passed to your POST, than what the tag of the button is. So i came up with this little PHP work around so that you can still use \<button\> tags, have fancy looking buttons with pictures and such inside, and stay sane with your POST/GET data.

So normally your tag would be go along these lines:

```auto
<button type="submit" name="order" value="fast">Fast Orders</button>

```

Instead use this, and mesh your variable name and value into the name, with a delimeter, im going to use =, but you can really use anything.

```auto
<button type="submit" name="order=fast">Fast Orders</button>

```

Then at the top of your php page your passing your form data to put this in.

```php
foreach ($_POST as $keys => $values){	//Search all the post indexes
	if(strpos($keys,"=")){ //Only edit specific post fields
		$vars = explode("=",$keys); //split the name variable at your delimiter
		$_POST[$vars[0]] = $vars[1]; //set a new post variable to your intended name, and set it to your intended value
		unset($_POST[$keys]); //unset the temporary post index.
	}
}

```

So hope that helps you or anyone, and I’m back off to battle the Internet Explorer monster for more errors.

-Phorte
