HOWTO: Submitting a Form From an Anchor (<A HREF=...>).

Last reviewed: May 29, 1997
Article ID: Q166210
The information in this article applies to:
  • Microsoft JScript, version 1.0

SUMMARY

This article describes how a form can be submitted to a server through the use of an anchor. It uses the little-known ability of JScript that allows you to run a script from an anchor without using events.

MORE INFORMATION

There are two simple steps to submitting a form from an anchor:

  1. Be sure the form has values for the NAME, ACTION, and METHOD properties. The NAME and ACTION properties are the only required ones, but it is a good idea to supply the METHOD also, for example:

          <FORM NAME=Form1 ACTION="http://myURL/MyPage.HTM METHOD=POST>
          </FORM>
    

  2. Call a one-line script from an anchor. In the script, call the submit method of the form, for example:

          <A HREF="JAVASCRIPT:Form1.Submit()">
    

REFERENCES

For additional information on JScript and forms visit the Microsoft Sitebuilders Workshop at http://www.microsoft.com/workshop.


Additional query words: jscript javascript script
Keywords : vbObjMdlIE vbObjMdlOther
Version : 1.0
Platform : WINDOWS
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.