Solved

When a use clicks the datefield, popup cfcalendar

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
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 tutorial demonstrates a quick way of adding group price to multiple Magento products.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

929 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

17 Experts available now in Live!

Get 1:1 Help Now