Solved

When a use clicks the datefield, popup cfcalendar

Posted on 2009-03-30
3
1,008 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

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 …
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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