Solved

When a use clicks the datefield, popup cfcalendar

Posted on 2009-03-30
3
977 Views
Last Modified: 2012-05-06
I am using coldfusion datefields in many of my apps.  Lots of times my users will just click in the datefield instead of the calendar image next to it to launch the cfcalendar.  I would like to launch the calendar when the user clicks in the datefield.
0
Comment
Question by:MFredin
3 Comments
 
LVL 2

Assisted Solution

by:albrandwood
albrandwood earned 25 total points
ID: 24025126
The calendar used is based on http://developer.yahoo.com/yui/docs/YAHOO.widget.Calendar.html

You could probably trigger the calendar to show with a command along the lines of:
_cf_DATEFIELD_init_1238461937299.show() ... the problem is that the function name is dynamically generated by CF.

This is the primary reason I don't use the dynamic Javascript built by CFForms.  I'd rather integrate the yahoo Calendar widget myself, and know the API entrypoints.

So good luck (and I'm gonna keep monitoring this thread, just incase there is an easy solution)
0
 
LVL 27

Accepted Solution

by:
azadisaryev earned 100 total points
ID: 24025268
with a little bit of jQuery you can do anything!

Azadi



<!--- in the HEAD section of your page: --->

<script type="text/javascript" src="path/to/jquery.js"></script>

<script type="text/javascript">

var showDP = function(el, f) {$('#'+el+f+'_cf_container').show();}

</script>
 

<!--- your form --->

<cfform name="f1" action="" method="post">

<cfinput type="datefield" name="date1" onClick="showDP(this.id, this.form.id);">

</cfform>

Open in new window

0
 

Author Comment

by:MFredin
ID: 24025298
Thanks Azadi!!!! jQuery rocks!!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now