1 form, 2 submit buttons.. how can I ...

trend

Centurion
Joined
Oct 12, 2004
Messages
171
I have 1 form, with 2 sets of information:

Billing Address
<submit button>

Credit Card Information
<Submit Button>

When a user presses the enter button after typing something, the first <submit button> is automatically used. How can I make it so.. if the user is typing in credit card info, and he hits enter.. the <submit button> for CC info will be submited instead of the other?

thanks!
 
Complex problem/ Simple Solution.

Instead of having 2 submit... keep only 1.

Put a radiobutton to let the user fill the right section.

Base yourself upon that radio button to process either one of those.

This is it :)

The KISS again :) (Keep It Simple Stupid)
 
You could also use javascript to look for character 13 on key press of the field and manually click that button to keep your seperation of concerns, or make it so that the form doesn't automatically submit when you press character 13 (the return key).
 
Back
Top