SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    May 2014
    Posts
    4
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    How i can submit a form without a submit button?

    Hello friends !
    Please tell me the coding regarding the submission of the form in PHP without using the submit button.

  2. #2
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Just remove the "Submit button".
    I think using the "Enter" key in your keyboard the form will submit.
    Quality codes are optimized and tested...
    Click here for inspiration..

  3. #3
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    73 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MartandTech View Post
    Hello friends !
    Please tell me the coding regarding the submission of the form in PHP without using the submit button.
    So what trigger would you use to make the form submit?
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  4. #4
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,889
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)
    I believe return works fine but only for a single input text/string field.
    I will try when on the desktop computer.
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  5. #5
    SitePoint Evangelist N9ne's Avatar
    Join Date
    Aug 2002
    Location
    UK
    Posts
    596
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    AFAIK, you need to have a 'submit' input field for pressing 'Enter' to submit the form. You can, however, hide the submit button using CSS.

  6. #6
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,889
    Mentioned
    74 Post(s)
    Tagged
    6 Thread(s)
    Just tried this and it works fine but only with a single input

    PHP Code:

    <?php echo '<pre>$_POST = 'print_r($_POST); echo '</pre>'$_POST=array(); ?>

    <form action='?' method="post">
    <div>
        <input type='text' name='fred' value='Look Ma, No "SUBMIT"' />
    </div>
    </form>
    Output:
    $_POST = Array
    (
    [fred] => Look Ma, No "SUBMIT"
    )
    Edit: Just remembered radio buttons also work without a submit button
    Last edited by John_Betong; Jun 9, 2014 at 08:10. Reason: spelling, not my fortay
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014


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
  •