what happens method="post" action=""

Discussion in 'HTML & Website Design' started by bunker, Sep 6, 2007.

  1. #1
    hello folks, what happens when the action field is empty? which script handles the post action?

    method="post" action=""
     
    bunker, Sep 6, 2007 IP
  2. Munkyonline

    Munkyonline Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Nothing will happen. You need an action for the form to be processed I believe.
     
    Munkyonline, Sep 6, 2007 IP
  3. bunker

    bunker Peon

    Messages:
    81
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No no, there is a web page with the example above and it works perfectly, but i couldnt figure out which script runs there
     
    bunker, Sep 6, 2007 IP
  4. Gordaen

    Gordaen Peon

    Messages:
    277
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Typically a blank action means to pass the data back to the original page, but it's best to put something in the action field for browser compatibility.
     
    Gordaen, Sep 6, 2007 IP
  5. Synchronium

    Synchronium Active Member

    Messages:
    463
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #5
    Some forms might use a fancy bit of javascript, or AJAX to submit themselves, rather than using the mechanism provided.
     
    Synchronium, Sep 6, 2007 IP
  6. bluegrass special

    bluegrass special Peon

    Messages:
    790
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    0
    #6
    The action determines which page to send the information to. When this area is left blank then it defaults to sending the info back to the same page (Postback). Code on the page will then be set to either run on a pageload or postback event.
     
    bluegrass special, Sep 6, 2007 IP
  7. Munkyonline

    Munkyonline Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I never knew that! Well that's one new thing i've learnt today :)
     
    Munkyonline, Sep 10, 2007 IP
  8. tarponkeith

    tarponkeith Well-Known Member

    Messages:
    4,758
    Likes Received:
    279
    Best Answers:
    0
    Trophy Points:
    180
    #8
    Just like BlueGrass said, it posts back the same same page.... Using this, you could have both sides of the form (input & processing) in the same page...

     
    tarponkeith, Sep 10, 2007 IP