Solved
JS/AJAX/jQuery Load Trigger for Embedded 2.0 Forms?
I'm trying to add descriptive classes to each .mktoFormRow on my embedded form 2.0.
One for checkboxes (so I can overcome the lack of 2.0 ability to put the box on the left -- WTF)
One for hidden fields (so I can add margins and other styles to .mktoFormRow without the hidden ones pushing stuff around)
This is my jQuery script:
This script runs perfectly (minus the trigger of course) in the Console in my browsers, but it doesn't work the way it's supposed to.
I've tried using the (window).ready, (document).ready, and even MktoForms2.whenReady but none of them work. What can I use to trigger my script after all fields have been loaded? I'd like to avoid a static timeout if I can.
One for checkboxes (so I can overcome the lack of 2.0 ability to put the box on the left -- WTF)
One for hidden fields (so I can add margins and other styles to .mktoFormRow without the hidden ones pushing stuff around)
This is my jQuery script:
jQuery(window).ready(function() {
jQuery('input[type=hidden]').each(function(){
jQuery(this).parents('.mktoFormRow').addClass("hidden");
});
jQuery('input[type=checkbox]').each(function(){
jQuery(this).parents('.mktoFormRow').addClass("checkbox");
});
});
jQuery('input[type=hidden]').each(function(){
jQuery(this).parents('.mktoFormRow').addClass("hidden");
});
jQuery('input[type=checkbox]').each(function(){
jQuery(this).parents('.mktoFormRow').addClass("checkbox");
});
});
This script runs perfectly (minus the trigger of course) in the Console in my browsers, but it doesn't work the way it's supposed to.
I've tried using the (window).ready, (document).ready, and even MktoForms2.whenReady but none of them work. What can I use to trigger my script after all fields have been loaded? I'd like to avoid a static timeout if I can.