Tell us what you are trying to do?
Run a Cred form in an Elementor popup modal, which seems to be a lightbox modal.
Is there any documentation that you are following?
Not really, just load a Cred form into a popup via the Elementor widget.
Is there a similar example that we can see?
https://toolset.com/forums/topic/generic-field-datepicker-inside-a-modal-window/
What is the link to your site?
This form isn't visible without logging in.
I have a cred form that is just meant to edit a post type, and two of the fields are dates. If I use the form on a normal page it works fine, but I want it in a modal. So I've been using Elementor's popups for handle this functionality, and everything is fine except that the date pickers don't work. It knows they're clickable, but when you click, nothing appears and Toolset date fields don't allow for manual entry.
I've seen this issue complained about in various places including these forums, but there's not straight answer I can see. I've checked the z-index of the date picker, I've tried loading the bootstrap date picker and get the same result. I suspect it's to do with when the script is being called or enqueued, so I've tried forcing the bootstrap date picker to run using the cred_form_ready hook like this:
jQuery(document).on('cred_form_ready', function() {
var date_input = jQuery('input[name="test"]');
var container = jQuery('.bootstrap-iso form').length>0 ? jQuery('.bootstrap-iso form').parent() : "body";
var options={
format: 'mm/dd/yyyy',
container: container,
todayHighlight: true,
autoclose: true,
};
date_input.datepicker(options);
})
but that doesn't work either. I know it's not setup properly but it just replaces the Toolset picker and doesn't apply to the other test fields but won't load on the form at all.
Here's the snippet of the form code for reference:
<div class="form-group">
<div class="row">
<div class="col-md-6">
<label for="%%FORM_ID%%_event-start-date">[cred_i18n name='event-start-date-label']Start Date[/cred_i18n]</label>
[cred_field field='event-start-date' force_type='field' class='form-control' output='bootstrap']
[cred_generic_field type='textfield' field='test']
{
"required":0,
"default":""
}
[/cred_generic_field]
<input class="form-control" id="date" name="date" placeholder="MM/DD/YYY" type="text"/>
</div>
<div class="col-md-6">
<label for="%%FORM_ID%%_event-end-date">[cred_i18n name='event-end-date-label']End Date[/cred_i18n]</label>
[cred_field field='event-end-date' force_type='field' class='form-control' output='bootstrap']
</div>
</div>
</div>
As you can see, I've got three different Start Date fields there trying to find a way or getting the date picker to load, and it just will not.
So is there a way of enqueuing the Toolset datepicker so that it runs on the form in a modal window?