Colby,
The onblur handler is client-side, so you should be using JavaScript for
the diff function, not CF. Grab a JavaScript reference (see
developer.netscape.com) and use the Date object and its methods.
If you want to use CF, you must submit the form and do the CF computation
on the form's action page.
-David
On Sun, 16 Apr 2000 15:29:56 -0500 Colby L Reese <[EMAIL PROTECTED]>
writes:
> I am trying to create some kind of script to calculate the difference
> between two dates. It would be nice if this would calculate right
> after the date is entered in the form using
> onblur and a function. I have tried messing with some scripts
> similar to what's below just to try using cf functions inside a
> javascript. I would like to use the datediff function
> but I have not found a good way to get coldfusion to execute it
> using an onblur.
>
> Thanks
> Colby
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>
> <html>
> <head>
> <script language="JavaScript">
> <!--
>
> function diff()
> {
> <cfoutput>
> document.test.date.value = #DateDiff("D", CreateDate(2000, 1, 1),
> Now())#
> document.test.date2.value = #ParseDateTime(document.test.date1)#
> </cfoutput>
> }
>
> // -->
> </script>
>
> <title>Untitled</title>
> </head>
>
> <body>
> <cfoutput>
> #Now()#
> <form name="test">
> <input type="Text" name="date">
> <input type="Text" name="date1" onBlur="diff()">
> <input type="Text" name="date2">
> </form>
> </cfoutput>
>
>
> </body>
> </html>
________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk! For your FREE software, visit:
http://dl.www.juno.com/get/tagj.
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.