SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to confirm a form has been submitted?

    Hi,
    I'm making some PHP classes displaying and validating forms.

    I'm wondering how I should confirm that the form has been submitted?
    Should I rely on that the Submit button has to be pressed or should I add a hidden field and checking for that field to be set, so if the user hits the Enter the form still get posted?

    Some comments on this with regards to usability would be very much appreciated.

    -Helge

  2. #2
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    maybe i'm misunderstanding your issue, but i would just have PHP check that all the variables it's expecting from the form in order to work correctly are actually set. the submit variable is also sent if a user hits enter, so there's no real distinction there between hitting the submit button or hitting enter...
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  3. #3
    SitePoint Wizard
    Join Date
    Oct 2001
    Posts
    2,686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by redux
    the submit variable is also sent if a user hits enter, so there's no real distinction there between hitting the submit button or hitting enter...
    Thank you!
    I thought I read here at SPF that in some browser the Submit button value will not be sent if you hit Enter on keyboard.
    But then I've probably misunderstood something or remembering it wrong.

    Nice, then there's less to code.

    -Helge


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
  •