I’m having a PHP/MySQL giftlist and people can click “reserve”-button to reserve one piece of gift. Thing is that in that list there is gift which has been wished like 10 times. So to reserve all 10 pieces of certain gift one has to click the reserve-button 10 times and javascript always confirm if one is willing to reserve one piece of that gift.
What I’m now after is that change that javascript confirm to confirm+form which will send data to action.php.
In HTML it would look like this:
<p>How many piece of gift are you willing to reserve?</p>
<form action="action.php" method="post">
<input type="text" name="giftammount" />
</form>
And when confirm returns true it will submit the answer and action.php will do the magic for MySQL table.
So, is this even possible technically? Not that i’ve tried, i’ve spent several hours wondering this but can’t figure this out.
If you’re using jQuery UI then the dialog widget could be just what you need:
Take a look at the jQuery UI page for an example and basic code