SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru etidd's Avatar
    Join Date
    May 2011
    Location
    atlanta, ga
    Posts
    632
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Smile Check E-mail Submission - PHP Equivalent to $_POST or $_GET Variables?

    Hi,

    I'm trying to figure out the best solution for my e-mail submission box at my website here. Because of the predefined string methods in JS, namely match() and substring(), I want to do the following:

    Test if the submission has a '@' and a '.com', '.net', '.org', '.biz', etc. in it.

    Is there an equivalent method to PHP's $_GET or $_POST in JS to grab the data just submitted from the input field in the form with the name 'go'?

    Thanks for the help.

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,889
    Mentioned
    210 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    What you can do is attach an onsubmit event to your form.
    This means that when the user submits their data, a function is fired which validates the user's input.
    If the input meets the appropriate criteria, the function returns true and the form is submitted.
    Otherwise the function, displays an error message and returns false. This will stop submission.

    If this is the kind of thing your after, it's not hard to code, so just let me know.


Tags for this Thread

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
  •