113
rated 0 times
[
114]
[
1]
/ answers: 1 / hits: 32123
/ 11 Years ago, mon, october 14, 2013, 12:00:00
I'm trying to add a button to my form that would essentially run some different php code than my regular form submission code, that would, instead of emailing me the form, convert my page into a nice pdf ready to print. I have everything working except that pressing the button is giving me an error.
Firebug says :
Here's the code:
<form id=adaugareanunt name=adaugareanunt action=mailerPDF.php method=post>
<table width=535 border=0 cellspacing=2 cellpadding=3>
<tr class=TrDark>
//... more form code
and for the button:
<div style=text-align:right><img src=images/print-button.png onClick=chgAction() width=60px height=20px></div>
with the script:
<script language=JavaScript type=text/JavaScript>
function chgAction()
{
document.getElementById[adaugareanunt].action = mailerXFDF.php;
document.getElementById[adaugareanunt].submit();
document.getElementById[adaugareanunt].action = mailerPDF.php;
}
</script>
More From » jquery