Hello... I have a form which consists of 2 parts: New Member: [Login image submit button (name = new)] Existing Member: [email address text box], [password text box], [login image submit button (name = existing)] Now that all works fine normally, however, when someone enters email address & password as an existing member and hits enter on keyboard, the form is submitted but seems to default to first submit button which is New Member login which throws back error saying email address is already used. Is there any javascript i could use that on enter keypress would submit the form passing name of the second image submit?
The simplest solution would be to use two forms pointing to separate pages. If you must use the same form for both, then you would probably have to intercept keystrokes using onkeydown or onkeypress and then call the click() method of the second submit image.
Simpler still, use a name for each submit button (ie <input type="submit" name="submit_1" value="Submit">), then use a different php if statement for the types. if (isset($_POST['submit_1'])) { -- Form Handle } else if (isset($_POST['submit_2'])) { -- Form Handle } else { -- whatever error message }