Manually invoke XenForo's 'date' field type.

Jake B.

Well-known member
I'm working on a rather large add-on for a client and part of it is adding multiple form fields into a page via javascript when you click a button. I have this working fine, however, one of the fields is of the 'date' type, but since it is added after the document has been loaded XenForo doesn't make it match all of the other date inputs, it just uses the default behavior of the browser (and in the case of a few it just behaves as a text input field). I was just wondering how I could manually make the function that changes the behavior of this field run manually when that button is clicked and the fields are added.

A good example of this would be the 'newer than' field in the search page
 
@kylerc got this figured out. Just needed:

Code:
XenForo.create('XenForo.DatePicker', $('#ctrl_stage_'+this.lastStageKey+'_start_date'));

while adding the fields :)
 
Top Bottom