|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
You should ask this in the Javascript forum.
And I'm not sure what you're asking in that last part....there is no way to write to a database from standard Javascript. You MIGHT be able to do it with something like AJAX but again, these are all Javascript questions.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
how about using <cfwddx> tag? i remember doing something like this before but i forgot how i did it.
is there someway to serialize the form data and pass it to another cfm page where i can create a db record then close all the windows ? |
|
#4
|
|||
|
|||
|
Still not sure I follow. Why not just post the form and then you can do anything you like. If the idea is to take the form data and do something with it on the server without doing a form post, then the only two ways you can do this (with any application server) are to use Javascript to pass the data to a hidden frame or to use AJAX to execute an HTTP call within the Javascript itself.
|
|
#5
|
|||
|
|||
|
could you explain what AJAX is? is this the football team from the Netherlands?
by the way, they want the record the customer information if the customer closes the order form, or hits go back or goes to another url. so, anything s/he enters until that point they want to capture it. i thought i could do it with WDDX but didn't happen. i did send the form to another page where i did my insert and then send it back to the opener. but this is handled by a pop-up. they dont want any pop-ups. :P is there anyway of doing this? thanks for the help in advance |
|
#6
|
|||
|
|||
|
What they are asking for is not feasible using a web browser. The user has total control of what they do, and that includes closing the browser and pressing the back button. Now again, you can try to build an AJAX system (asynchronous Javascript and XML) that fires HTTP requests to the server in response to browser events using the XMLHTTPRequest() Javascript method. However, it is not very good practice to break the users expectations of what will happen when they perform certain browser activities. Also, the user can disable Javascript which will nullify all your hard work. And finally, AJAX is quite complex and is only supported by newer browsers. However, if you still want to give it a try you can Google AJAX. Also, here is a site by a developer who has done some integration between AJAX and ColdFusion:
http://www.indiankey.com/cfajax/ |
|
#7
|
|||
|
|||
|
wow, i did it with AJAX and XMLHTTPRequest()
it's sooo cool thanks for the heads up |
|
#8
|
|||
|
|||
|
Any time!
![]() |
|
#9
|
||||
|
||||
|
Just a headsup, gmail used XMLHTTPRequest() and it was not supported by many browsers, therefor they had to create another version of gmail that is less demanding, but if you all of your customers just have the newest version of Internet Explorer, I suppose that is fine.
I really don't like the idea of stealing customer information, that they do not want to provide it if they are clearly attempting to cancel the transaction. Could your unethical practices be why you have 10 warnings, and 1 ban? Last edited by tac : July 21st, 2005 at 09:07 AM. |
|
#10
|
|||
|
|||
|
Agreed that this can get into the grey area, but for something like an Intranet where you know the users are on IE, Firefox, or Safari, and you are doing this for some estabilished business reason, this approach might be fine. However, if you're doing this to anonymous public users then you can probably expect a backlash or a decrease in the use of your site.
|
|
#11
|
|||
|
|||
|
Quote:
This application is not designed to "STEAL" customer information. Furthermore, "unethical practices be why you have 10 warnings, and 1 ban?" is none of your business. I got those because i simply told people what i really thought about the sites they posted on the web site crituque forum. If you don't have anything to say about my original post, keep your stupid comments to yourself!!!! |
|
#12
|
||||
|
||||
|
Is this what you mean by telling somebody what you really thought of their site, when they asked for a critique? What you said had nothing to do with the person who posted, it was about another person's avatar:
Quote:
|
|
#13
|
|||
|
|||
|
shut da fu. up
|
|
#14
|
|||
|
|||
|
if you got no time to put some together, at least post something when you do. don't show us some $hittie front page look text filled cr@p! there are tons of them out there. go do your work, till then dont say nuttin
i know you won't be able to "Comprehend" this part. |
|
#15
|
|||
|
|||
|
Ok guys that's enough. If you want to keep knocking each other take it to private messages please.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > is this possible ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|