Comment

GreatBigMassive

There should be a piece of code around that foreach statement in the fixPOST() function. This would be

if(count($_POST)){

}

Obviously, you do this to make sure the function only runs when $_POST data is detected. DOH!!!!

Parent comment

GreatBigMassive

. . THE GENERIC SOLUTION ========================== Here's your solution. You don't have to worry about Javascript or anything like that. STEP 1: Create your button -------------------------------------------------------------------------------- STEP 2: Create a hidden field for the button The hidden field should have the same value as the button but its name should be prefixed with 'iefix_' ------------------------------------------------------------------------------------------------------------------------------- STEP 3: Fixing your $_POST Data -------------------------------------------------------------------------------- This is a PHP code example. Basically, when you submit the form, at the very top of your page before you do anything with your form data, you run this function. /* Start of function */ function fixPOST(){ foreach($_POST as $k=>$v){ if(substr($k,0,6) == "iefix_"){ $k2 = str_replace("iefix_","",$k); if(isset($_POST[$k2])){ $_POST[$k2] = $v; }unset($_POST[$k]);}}} /* End of function */ STEP 4: Check your POST data ------------------------------------------------------------------------------- After the function runs, print your post data and you should have everything in place just as you wanted it.