The following PHP code works fine with javascript in Internet Explorer but fails in Firefox. Javascript is enabled in Firefox. It appears that when the button/icon is clicked, it enters the javascript function, but doesn't change the icon on the page. It also seems to return to the PHP code/page incorrectly. The PHP code/page was entered with a parameter (http://www.PRCmembership_admin.php?PRCma=payment). When it apparently returns from javascript, the ?PRCma=payment is missing.
PHP Code:
$mt_deleteicon_name = "mt_deleteicon" . $tranrec; //Unique name associated with a mysql record
$mt_deleteimage_name = "mt_deleteimage" . $tranrec; // Ditto for icon image
$mt_delete_name = "mt_delete" . $tranrec; // Ditto for delete indicator
<button id="$mt_deleteicon_name" value="Delete" onclick="settdelete($tranrec)">
<img id="$mt_deleteimage_name" src="images/x_delete.ico" /></button>
Javascript Code:
function settdelete(trankey)
{
var mtdelname = "mt_delete" . concat(trankey);
var mticonname = "mt_deleteicon" . concat(trankey);
var mtimagename = "mt_deleteimage" . concat(trankey);
document.getElementById(mtdelname).value = "D";
document.getElementById(mtimagename).src = "images/x_undelete.ico";
return;
}