Adding a value from a text box without a Form Submit
Experts, in a related post, I received a solution of listing out the 2 teams for different games.
There is a "Choose!" button next to each team which:
- Allows the user to Choose one of the 2 teams
- Inserts that Choice into the database with the
Since each line has it's own submit button, the Form itself does not have one.
This has been working fine, but...
Recently, I realized that I needed to add ONE text field to allow the users to type in the total number of points (INT) as a tiebreaker...
Something like this:
echo "<CENTER>For Tiebreaker, Enter total points in Game #10 above: <input name='Tiebreaker' type='text' size='5' maxlength='5'></CENTER>";
Since the form itself doesn't have a submit button, I would like to
- Have the user enter their number in the box
- Click a SUBMIT NUMBER button right next to the text box
- Have the number insert into the database
INSERT INTO TIEBREAKERS SET
userid = '$MemberID'
tiebreaker = //Number from the Text Box
- And have the text box show the chosen number after it's entered into the database (in case the user wants to change it)
You can't. As far as I know, since a query has to run on server side, you must pass through the server, that is you must post a form. I have to ask: you have only one form with several submit input or you have several form each with its own submit input?
Anyway, I would suggest to change the logic of your app: use only one form, replace choose buttons with radios and place in the bottom yout text box for tiebreaker. Finally a beautiful submit button wich pass both choosen team and tiebreak value to insert them in db. Could you consider to use this design pattern?
Anyway, I would suggest to change the logic of your app: use only one form, replace choose buttons with radios and place in the bottom yout text box for tiebreaker. Finally a beautiful submit button wich pass both choosen team and tiebreak value to insert them in db. Could you consider to use this design pattern?
Best, marqusG