EasyCFM.COM ColdFusion Forums / Coding Help! / is this possible ?

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: is this possible ?

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

falconseye
07-19-2005 @ 4:24 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 1033
Joined: Mar 2004

i am trying to capture the value of a textfield with

<body onUnload="getVal()">

is there a way to write the value of
  <input type="text" name="textfield">

if the user closes the window or hits the back button on the browser menu ?
this would trigger getVal() function, somewhere in the

<script ..>
  function getVal()
{
  write to the db table
}
</script>

thanks for the help in advance

JJfutbol
07-19-2005 @ 4:38 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1250
Joined: Nov 2004

You forget that JavaScript is client side so that won't work. But if I'm correct onUnLoad can do something like open a new window or redirect somewhere. Get it to do that first before writing to the db. So it would redirect or open another window where it calls a cfm file that will write whatever the form value is to the db.

----------------------------------------------------
Need FREE CF applications?? Then my site has it all, http://www.mygamingnation.com/downloads.cfm In time I will be including many more free CF apps as you will see many listed up top on that page.

GrowlyBear
07-19-2005 @ 4:42 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Moderator
Posts: 1314
Joined: May 2004

I would suggest OnBlur() to activate the code that way it gets done before the window is closed. if the back button is hit then it is harder as that page has to reload to get the new values.

~~~~~~~~~~~~~~~~~~~
There is no place like 127.0.0.1

falconseye
07-19-2005 @ 4:49 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 1033
Joined: Mar 2004

You forget that JavaScript is client side so that won't work.
->> i can use <cfwddx> to capture the information

But if I'm correct onUnLoad can do something like open a new window or redirect somewhere.
->> the idea neither to redirect nor to open a new window. just capture the information then close the window.



falconseye
07-20-2005 @ 12:35 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 1033
Joined: Mar 2004

this is all done! and i am sooo sexiee in my shirt...



Website Designed and Developed by Pablo Varando.