Forum Moderators: open

Message Too Old, No Replies

how to store form data into database before submit

         

bonagiri

2:43 pm on Jul 31, 2008 (gmt 0)

10+ Year Member



Hello Everyone,

I have an html submit form.

I want to store data into database before submit.

I'm not quite sure what is the best way to do this. I would really appreciate any suggestions!

Thanks in Advance,
bonagiri.

Fotiman

4:36 pm on Jul 31, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You'd need to use AJAX, so you shouldn't rely on this functionality because users could have JavaScript disabled or they could be using a browser that doesn't support AJAX.

Basically, determine when you want this update to occur. Then use AJAX to send data to your server to be saved. When it returns, your callback method could then perform the form submit.

if you need help with AJAX, you might consider using a framework that simplifies it. I like the Yahoo UI Library [developer.yahoo.com]'s Connection Manager. Well documented and easy to use.

janharders

4:47 pm on Jul 31, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



not necessarily ajax, but javascript. you could always add an invisible iframe and submit the information in a form in said iframe, thus not reloading the whole page. I know, it's been an early ajax-style, just bringing it up because most people only think of the whole http-request-from-javascript when talking ajax

bonagiri

11:29 am on Aug 1, 2008 (gmt 0)

10+ Year Member



Thanks for your suggestions!

But I'm totally new to AJAX and JavaScript.

My problem is:

I want to store each form field data entered by customer into database automatically.

For example: when customer enter the firstname, the firstname must automatically store into database.
Like that the entire form data entered by customer must store into database before submitting the form.

I need some sample code for this in JavaScript.
help me please?

thanks in advance,
bonagiri.