Solved

When a use clicks the datefield, popup cfcalendar

Posted on 2009-03-30
3
1,013 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

Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

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

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

726 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