This is one of those things I've always wanted to do, but never get a
chance to...
Basically this is how I would do it.

<script>
function getObject(nameStr) {
        var ns4 = document.layers ? true : false;
        var ie = document.all? true : false;
        var dom = document.getElementById && !document.all ? true : false;
        if (dom) {  return document.getElementById(nameStr); }
        if (ie) { return document.all[nameStr]; }
        if (ns4) { return document.images[nameStr]; }
}

var dataPipe = getObject('imgDataPipe');

function saveData(fObj) {
  field_name = fObj.name;
  field_value = fObj.value;
  dataPipe.src = "saveFormData.cfm?saveField=" + field_name +
  "&value=" + field_value;
}
</script>

<input type="text" name="f_name" onblur="saveData(this)">

<img src="saveFormData.cfm" id="imgDataPipe" name="imgDataPipe">



saveFormdata.cfm:
<cfif isDefined("url.saveField")>
  <cfset session[url.saveField] = url.value>
</cfif>
<cfcontent type="image/gif" file="1x1.gif">

Typed that as I went, so it probably has a few problems. Should get
you started though. I'll probably reference this post when I actually
get to creating a real onblur save library for myself...so thanks :)

-- 
 jon
 mailto:[EMAIL PROTECTED]

Tuesday, October 1, 2002, 9:29:55 PM, you wrote:
PC> Is there a way I can save the data from a form field BEFORE the submit button is 
pressed?  I thought I saw something awhile back that used javascript to
PC> save each line to a db onBlur  ?  Has anyone done this or have an idea on how it 
can be done?  Thanks.

PC> Paul Campano

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to