Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Dojo implementation of the "improved user interaction with XPages date picker" script (jQuery) by Marky Roden (src: This uses pure Dojo (which can prevent the need to load another library, if you're already using Dojo). This is used and tested with Dojo v. 1.6.1. …
* Dojo version of the improved behavior of the XPages calendar picker.
* Adapted from the jQuery version, originally by Marky Roden.
* credit:
* Adapted by Eric McCormick, @edm00se,
//id has _Container and is class of xspInputFieldDateTimePicker
var myAr = dojo.query("[id$=_Container].xspInputFieldDateTimePicker");
//iterate over each element to apply affect
myAr.forEach(function(node, index, arr){
//current root node, based on id$=_Container
var curNode = node;
//span for the button to fire the picker
var myBtn = dojo.query('> span > span > span.dijitButtonContents',curNode)[0];
//actual <input> element into which is focused/typed
var myInputFld = dojo.query('> div > div.dijitInputField > input.dijitInputInner',curNode)[0];
//connect the focus event to the picker click event
//provide an onkeypress preventDefault
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment