How to Change the Form Action in JavaScript Select

How to Change the Form Action in JavaScript Select thumbnail
Javascript controls form elements on your website.

Javascript is a language used to automate some actions on a website. The language is run on the user's computer, so the programmer can change the "action" property in a form located in a web page. The action property controls the form's submission page. The submission page processes the information input by the website visitor. You can change the action property in your forms using a few lines of Javascript code.

Instructions

    • 1

      Open the web page that will contain the Javascript code. You can use a simple text editor such as Notepad to add the scripting code.

    • 2

      Create the Javascript block tags. All Javascript code should be contained within the following script tags:
      <script type="text/javascript"> </script>

    • 3

      Use the following code to change the action property in your HTML form:
      document.myform.action = "myActionscript.asp";
      Replace "myform" with the ID of the form on your web page. The "myActionscript.asp" is the file used to process the form information. This can be any script page on your domain.

    • 4

      Click the "Save" button and open the file with your web browser. The form's action variable is dynamically changed to the new page.

Related Searches:

References

  • Photo Credit http image by chrisharvey from Fotolia.com

Comments

You May Also Like

Related Ads

Featured