SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Location
    Portland, OR
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hyperlink to submit form

    hey! just wondering if anyone knows how to use javascript to submit a form when a hyperlink is clicked, or if anyone knows where i can find a script that does this? i need to do this so i can pass hidden fields when client changes pages

    TIA!

  2. #2
    SitePoint Enthusiast RogueJedi's Avatar
    Join Date
    Oct 2001
    Location
    Texas
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are several diffent ways to accomplish this (as is the case with most things in web programming). The simplest thing to do is just put a submit button in your form. But, one of the simplest ways to submit a form with a hyperlink would be to call the form's submit method directly from the link:
    Code:
    <a href="someformprocessor" onclick="document.formname.submit()">Submit the form</a>
    There are some good tips on forms in general at irt.org's JavaScript FAQ. They have a section on submitting forms that is very helpful.
    Rob Nolan
    Do or do not, there is no try.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •