Hide Button with empty field

I have a submit button that I would like to hide until validations has validated fields are not empty. I know through JS that I can write function as

$(document).ready(function() {

else {

How do I accomplish this through dynamic attributes? 

lets say that you have a forrm with two inputs.
One with id=one
The other with id=two

To hide the button just add this inside the button tag
dmx-show="one.value!='' || two.value=''"

Hope it helps.
Thank you!

Thanks brov that was perfect.

1 Like