HTML.form.guide

form action

How to create a multi-submit form

Imagine you have a form that needs to be processed by different scripts based on user's input. (example: ‘update’ or ‘create new’) . You can use JavaScript to switch the action field of the form just when the submit button is pressed. See the page below for some examples: Switching the form's ‘action’ field dynamically What we will try to do in this post is still more adventurous: submitting the same form to multiple scripts at the same time!

Continue Reading →

Setting the Form Action with a JavaScript Function

In an HTML form, the action attribute is used to indicate where the form's data is sent to when it is submitted. The value of this can be set when the form is created, but at times you might want to set it dynamically. In this tutorial, we'll look at ways in which a form's action attribute can be set dynamically by JavaScript. To get started, create an HTML file and paste the following form to its body.

Continue Reading →