You are viewing limited content. For full access, please sign in.

Question

Question

datepicker broken as of today

asked on August 27, 2017

Hi,

I've built a jquery ui dialog to ask some information outside of the form, that then populates some of the form. one of the pieces collected in this dialog was a datepicker date - with a specific format, start date, and end date. As of some point today, it no longer works - an override is being called from within some LF javascript that breaks the control. In the referenced js file, a method (n.reInitializeDateField) looks for configuration info in a td[data-col] or li, then rebuilds the datepicker. This is a brand-new issue, and has broken at least one of our processes, if not more.

1 0

Answer

SELECTED ANSWER
replied on August 31, 2017

It looks like the issue is resolved, and another issue where the autofill button moved to the 2nd last lookup parameter (instead of the last) has resolved. Hopefully whatever caused these issues doesn't happen again outside of chosen, installed updates.

1 0

Replies

replied on August 28, 2017

Hi Jonathan,

Can you describe the method you used for passing date into the Forms date field? Is it passed through URL or custom script? Is there any default value/formula/lookup rules defined on the Forms date field?

And which version of Forms are you using?

0 0
replied on August 29, 2017 Show version history

It's not a forms date field. Basically, I have a function that shows a dialog, and several fields are pre-populated from that date selection. The actual date selection isn't important, which is why it's not in the form:

$('<div>').append('$('<input>',{type:'text',id:'txtDatePicker'}).datepicker({
	changeMonth: true,
	changeYear: true,
	showOtherMonths: true,
	selectOtherMonths: true,
	dateFormat: 'M d, yy'
	,minDate: new Date(pageSettings.Current.Year- 14,0,1),
	maxDate: new Date(pageSettings.Current.Year- 3,11,31),
	yearRange: '-14:-3'
})).dialog({
	buttons:[
		text: 'Update',
		click: function(){
			//auto-fill other fields that are part of the form
		}
	]
});

This had been working fine until Sunday mid-day; all the settings for the datepicker are now overwritten when the page loads. The datepicker within my dialog stopped working completely until I changed the dialog's root div to being a <td [data-col]> with data attached object {label: null} for .data('qfield')

0 0
replied on August 29, 2017

I tried your script and got the same issue.

In Forms script, when focus in an element with class 'hasDatepicker', it would call reInitializeDateField on this element before showing datepicker. Your datepicker field would be processed as well.

I can't figure out why it used to work for you, if the root div didn't changed.

0 0
SELECTED ANSWER
replied on August 31, 2017

It looks like the issue is resolved, and another issue where the autofill button moved to the 2nd last lookup parameter (instead of the last) has resolved. Hopefully whatever caused these issues doesn't happen again outside of chosen, installed updates.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.