Change form submit action and then submit the form
form submit change url
change form action on button click
button onclick submit form
dom change form action
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:
Adaugareanunt is an object key:
"Adaugareanunt" is a string passed to the
getElementById() method as argument:
Forms: event and method submit, Both actions lead to submit event on the form. The handler can preventDefault () , then the form won't be sent to the server. In the form below:. Find Submit Forms Online. Find Quick Results from Multiple Sources
Change the block brackets : 
The round brackets : ()
Square brackets means new Array.
var ar = newArray( " a " , " b " ) ; var ar = [ " a " , " b " ] ;
This works fine
Change the form action before submit, How to change the form action before submit on the basis of element/input field click.the html sample code for form having radio button and submit button :<form � If you would like to edit the text of the form submit button, you can click on the button to edit it. This can be useful if you would like the text of the button to say something other than "Submit". If you do not see the Submit button, please make sure you have added in at least one field to your form, and then the Submit button will appear.
- I'm still getting an error on the submit line. 'document.getElementById("adaugareanunt").submit();' 'TypeError: document.getElementById(...).submit is not a function'
- Fixed it like this: