Date: 06/19/02
- Next message: Niklas Lampén: "RE: [PHP-DB] Re: saving data"
- Previous message: Natividad Castro: "[PHP-DB] saving data"
- Next in thread: Niklas Lampén: "RE: [PHP-DB] Re: saving data"
- Reply: Niklas Lampén: "RE: [PHP-DB] Re: saving data"
- Maybe reply: Ryan Jameson (USA): "RE: [PHP-DB] Re: saving data"
- Maybe reply: Adam Royle: "Re: [PHP-DB] Re: saving data"
- Maybe reply: Beau Lebens: "RE: [PHP-DB] Re: saving data"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Very interesting question. One way you could do this, is using
javascript. Basically, you have two frames - one is the form, the other
is an invisible frame. Then, create a javascript function which sends
information about what field to update (and also the value to update to)
to the invisble frame, and put this function in the onBlur bit of your
form element.
Am I making sense? Basically, what it would do is update the database
after you click out (or tab or deselect a form element)
example...
this would be the HTML (depending on form contents and database design,
you might have to include a few more javascript parameters)
<input type="hidden" name="userID" value="<?= $userID ?>">
<input type="text" name="first_name"
onBlur="updateDB(this.name,this.value,userID.value);">
and the javascript might be
function updateDB(theName, theValue, userID){
top.invisbleFrame.href =
"update.php?name="+theName+"&value="+theValue+"&userID="+userID;
}
of course if you have a complex form/or specific database thingys, this
might be more complex, but basically this shows the data transfer
between pages
and in the invisbleFrame (update.php) you might have something like this:
<?php
dbConnect(); //obviously this is the database connection function
$sql = "UPDATE tablename SET $name = '$value' WHERE userID = $userID";\
mysql_query($sql)
?>
I hope that helps. If you need further help or explanation, ask!!!
Adam
> Hi to all,
> Is it possible to save information from a form without being
> submitted? I
> know this question might be a little extrange for some of you. The
> reason
> why I'm asking this question is because I collect information from
> different
> places where users fill out a big form, they're complaining because
> sometimes they are about to finish filling out the form when they lose
> connection
> I was wondering if there is a way to get this data temporaly and then
> when
> they reconnet to the system display all the fields with the information
> they
> already type in.
>
> If someone has any idea, please let me know
>
> Thanks in advanced
> Nato
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Niklas Lampén: "RE: [PHP-DB] Re: saving data"
- Previous message: Natividad Castro: "[PHP-DB] saving data"
- Next in thread: Niklas Lampén: "RE: [PHP-DB] Re: saving data"
- Reply: Niklas Lampén: "RE: [PHP-DB] Re: saving data"
- Maybe reply: Ryan Jameson (USA): "RE: [PHP-DB] Re: saving data"
- Maybe reply: Adam Royle: "Re: [PHP-DB] Re: saving data"
- Maybe reply: Beau Lebens: "RE: [PHP-DB] Re: saving data"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

