[streams-platform] Strange issue while adding form on front end
Created 7 years ago by lckamalI am adding a form like so:
{% set contactForm = form('leads', 'contacts').entry(contact).redirect('sales/contacts').get() %}
{{ contactForm.open|raw }}
{% for field in contactForm.fields %}
{{ field|raw }}
{% endfor %}
<div class="form-group">
<input class="btn btn-primary" type="submit" name="submit" value="{{ trans('theme::site.submit') }}"/>
</div>
{{ contactForm.close|raw }}
There is one boolean field which switch is based on admin theme. I have a ajax call on every 20sec to load new notifications. When the ajax is called css for field is loaded and design looks good. Here is screencast for the issue: http://take.ms/nqLn7 Any idea?
On page load: http://take.ms/whmgg After ajax call: http://take.ms/SPUnd0
May be because of this? http://take.ms/Ofs7X on app/default/assets/core/anomaly/boolean-field_type/resources/js/input.js?v=1485338512
$(document).on('ajaxComplete ready', function () {
setTimeout(function () {
// Initialize form switches
$('[data-provides="anomaly.field_type.boolean"]:not([data-initialized])').each(function () {
$(this)
.attr('data-initialized', '')
.bootstrapSwitch();
});
}, 10);
});
;
Same issue on other multiselect field type
ryanthompson
—
7 years ago
Can you verify the input CSS is being loaded?
Is your javascript deferred or included in the foot? Either way can you try changing it's position just for testing purposes? If it's in the head - move it to the bottom and vice versa.