Re: Saving form input fields to MySQL br clicking on a button
| From: | Sascha Cunz | Date: | Thu, 31 Oct 2002 20:57:04 +0000 |
| Subject: | Re: Saving form input fields to MySQL br clicking on a button | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122324@lists.php.net to get a copy of this message | ||
Hi,
> Hi,
>
> I have a form where the user enters some information. For a particular
> section of the form, I'd like the user to be able to save what he/she
> entered so that the next time they feel out the form, they can recall
> without the need to retype. This is not for the entire form but only for a
> few input text fields.
>
> I created a button called "Memorize" but how do I have the page save the
> values to my MySQL database when the user clicks on the button. I
> understand that I can only use JavaScript to trap the "OnClick()" function
> and not PHP but I cannot use JavaScript to write to a MySQL table. I do
> not want to submit as that would reload the form and the user would lose
> other changes to other fields.
>
> Any idea?
>
> Don
As you say it yourself, you can't use mySQL with JavaScript. Do a submit to a
php-script, and "restore" the original page in that php-script.
-Sascha