Alan,

the issue is that you are trying to do something in Javascript which
is client side with ColdFusion which is Server side.

The best thing to do is to convert it on the server side when you
submit. You are submitting to some page and in that ColdFusion code
you can do:

<cfoutput>
       #DateFormat(url.pubDate, "ddmmyyyy")#
</cfoutput>


That would format the date into the proper format for you to use in
the rest of your code.

The problem with working in Javascript is you always have to think
about when the user doesn't have it turned on and make sure you code
downgrades gracefully.


J.J.



On Fri, May 16, 2008 at 9:20 AM, a or <[EMAIL PROTECTED]> wrote:
> Thanks Zelda, just gotta read up on how javascript and coldfusion works best 
> together i guess....was hoping ColdFusion could take care of it all....
> alan
>
>> Well, my situation was a little different. I had the date already
>> supplied by the user from a form. Then I pass the date in the url, in
>> my case it was submitting to the same page. I do have another
>> application where the user picks a date from a calendar and it passes
>> the date just fine, but it uses beaucoup lines of JavaScript. Date js
>> code is easy to find. Some good JavaScript site:
>> http://www.w3schools.com/js/js_examples.asp
>> http://javascript.internet.com/
>> Zelda,
>> PS I'm a newbie too.
>>
>> -----Original Message-----
>> From: a or [mailto:[EMAIL PROTECTED]
>> Sent: Friday, May 16, 2008 9:42 AM
>> To: CF-Newbie
>> Subject: Re: Can CF format a form value on submit ?
>>
>> hmmmm....
>> not quite sure I understand how I'll do this.....
>> at the moment i'm using the following:
>>
>> <cfinput value="" id="pubDate" name="pubDate" type="text"/><br />
>>
>> what is the best approach to format as below
>>
>> <cfinput value="" id="pubDate" name="pubDate" type="text"
>> onSubmit="convert(this.value);"/><br
>> and then something like this ?
>>
>> function convert(pDay) {
>> <cfset pDay= #DateFormat(dateString, "ddmmyyyy")#> <cfoutput>
>
>> #DateFormat(pDay, "ddmmyyyy")#
>> </cfoutput>
>>
>> />
>>
>> >Try:
>> >
>> ><cfset dateString = "16 May 2008">
>> ><cfoutput>
>> >       #DateFormat(dateString, "ddmmyyyy")# </cfoutput>
>> >
>> >Adrian
>> >http://www.adrianlynch.co.uk/
>> >
>> >Hi,
>> >
>> >Is it possible to format a form value on submit using only Cold
>> Fusion ?
>> >
>> >I am using a calendar to populate a form field in the following
>> format
>> >16 May 2008.
>> >When I submit the form, I need the URL string to read as
>> >index.cfm?16052008 and NOT index.cfm?16+May+2008
>> >
>> >Is this possible to do this using ColdFusion only or should I use
>> >Javascript (or a combination of both maybe ?? using DateFormat inside
>> a
>> >javascript function.
>> >
>> >thanks in advance,
>> >
>> >alan
>>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;192386516;25150098;k

Archive: 
http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3639
Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to