Solved

When a use clicks the datefield, popup cfcalendar

Posted on 2009-03-30
3
993 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

810 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