Click to See Complete Forum and Search --> : Form submission question
Ashcrapper
06-09-2004, 07:20 AM
Hi
I want to create a form that once the user has submitted the info, it will take them to a page displaying what info they have submitted with a confirm button, if they confirm the info it will then insert the info into a database.
Ive no problem inserting the record upon submission of the form using the insert record feature of Dreamweaver MX 2004, and I know how to display what they have submitted on the next page.
Im just a bit unsure of how to only insert the info once they have clicked the confirm button on the 2nd page.
Can anyone help with this?
Thanks in advance
Ash
buntine
06-09-2004, 11:46 AM
On the HTML form, which surrounds the confirm button (which i am guessing is a form control submit button), you would set the 'action' parameter to the actual page that inserts the info into the database.
Therefore, the only way the user can get the record inserted is by clicking the submit (confirm) button.
Regards,
Andrew Buntine.
Ashcrapper
06-09-2004, 12:01 PM
Hi
Would that not just then take them straight to that page and insert the record?
Basically what im after is this:
1. User fills in the details on the form and clicks submit
2. Page displays the info they have submitted with a 'confirm details' button
3. Once they click confirm details it inserts the record into the database.
Cheers
Ash
lmf232s
06-09-2004, 01:38 PM
you answered your own question.
just insert the information to the database when you click the confermation button .
Ashcrapper
06-09-2004, 01:57 PM
:D
I dont know how though
lmf232s
06-09-2004, 03:40 PM
you know how to submit the record into the db when the form submits, correct? Well then do not add the record on the first form. Use the first form as pure data entry and capture. Then display it on the second page. Then set up your confirmation button, to be the button that submits the form. Im not sure how dreamweaver works and im not sure how you have it set up to insert the record when the page is submited. But this code for the button would submit the form.
<input type=button name=cmdSubmit onclick="document.NameofYourForm.submit()">
Then Im not sure what your doing to insert the record but if you can insert when the form submits then the code above will submit the form
If you want to post some code, we can see how you are submiting the data and maybe able to come up with a more efficient solution.
Ashcrapper
06-09-2004, 04:13 PM
thanks mate, when im back in work ill post up the code :)
buntine
06-09-2004, 11:10 PM
Just you a submit button... That will stop you from having to use JavaScript.