$("input, select, textarea")
.addClass("ui-widget ui-widget-content ui-corner-all")
.css({
padding: ".2rem .5rem"
});
So, I use the code above to display every input, select and textarea on my site in the same way as the elements I add using jQuery UI. This code is applied to every page on my site. It works fine and it adds the css and the classes to every input, select and textarea. Except on the input, select and textareas inside the dialog it doens't apply. I tried a lot of different things, but noting works. Anyone who knows how to do this? I could add the class manually but I have over 100 input fields spread over different dialogs
$(document).on("dialogopen", ".ui-dialog", function() {
$(this).find("input, select, textarea")
.addClass("ui-widget ui-widget-content ui-corner-all")
.css({
padding: ".2rem .5rem"
});
});
$( ".myDialogClass" ).dialog({
open: function() {
$(this).find("input, select, textarea")
.addClass("ui-widget ui-widget-content ui-corner-all")
.css({
padding: ".2rem .5rem"
});
}
});
I've tried both methods, but none of them worked
When I test with the following code, I seem to get the expected results.
The Input element inside the Dialog shows the following classes and style.