SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2005
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can you submit POST without button?

    Hi,
    this may be a really dumb question, but I was wondering if there was any way to submit POST data to another page without the user having to hit a "submit" type of button.
    Can this be done?
    Thanks
    Mike

  2. #2

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can also do it with JavaScript, but beside that there is no real solution.

  3. #3
    SitePoint Evangelist
    Join Date
    Jan 2005
    Posts
    502
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok thanks alot for the quick reply man,
    Mike

  4. #4
    SitePoint Zealot
    Join Date
    Jan 2005
    Location
    Baltimore, MD
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can do this with Javascript, and place the code into one of the events for any other object. The user has to do SOMETHING to trigger an event to submit the form, but it doesn't need to be clicking a submit button.

    In this example, you click an image to submit the form:

    HTML Code:
    <form id="myForm" method="post" action="form.php">
      Input: <input type="text" size="40" />
    </form>
    
    <img src="image.gif" width="100" height="80" onclick="javascript:document.getElementById('myForm').submit();" />

  5. #5

    Join Date
    Oct 2003
    Location
    €uroLand
    Posts
    1,340
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by graedus_dave
    You can do this with Javascript
    What I said.


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
  •