Autosubmit PHP Form?

Discussion in 'PHP' started by sumitt_2004, May 14, 2008.

  1. #1
    Can anybody tell me how can we create a form in PHP without a submit button? There must be no use of JavaScript. Can anyone help me?
     
    sumitt_2004, May 14, 2008 IP
  2. AsHinE

    AsHinE Well-Known Member

    Messages:
    240
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    138
    #2
    If you don't need a submit button just don't place <input type="submit"> tag.
    Form can be submitted by pressing Enter in text field.
    If you need more complex behaviour you should use javascript or maybe flash.
     
    AsHinE, May 14, 2008 IP
  3. msaqibansari

    msaqibansari Peon

    Messages:
    84
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    
    <body onload="form1.submit();">
       <form id="form1">
       </form>
    </body>
    
    Code (markup):
     
    msaqibansari, May 14, 2008 IP
  4. sumitt_2004

    sumitt_2004 Peon

    Messages:
    154
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I tried both way. But didn't work :(
     
    sumitt_2004, May 14, 2008 IP
  5. AsHinE

    AsHinE Well-Known Member

    Messages:
    240
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    138
    #5
    Try
    <body onload="form1.submit();">
    <form name="form1">
    </form>
    </body>
    But this uses javascript anyway;
     
    AsHinE, May 14, 2008 IP
  6. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #6
    Once the browser has the page and the visitor is looking at that page, things are completely out of PHPs' control.

    It is not possible to auto-submit a form without Javascript in some shape or form, period.
     
    joebert, May 14, 2008 IP