Results 1 to 2 of 2
Dec 19, 2012, 22:01 #1
- Join Date
- May 2011
- atlanta, ga
- 2 Post(s)
- 0 Thread(s)
Check E-mail Submission - PHP Equivalent to $_POST or $_GET Variables?
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.
Dec 22, 2012, 06:58 #2
- Join Date
- Jun 2007
- 215 Post(s)
- 12 Thread(s)
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.