Page 1 of 1

change class of button within html component

Posted: Tue Nov 03, 2015 5:15 pm
by Vinny B

Im trying to change the class of a button that is inside of a html component.
It works fine outside of Appery buy Appery automatically change the button class to

class="ui-btn ui-input-btn ui-corner-all ui-shadow ui-state-disabled"

So basically I need to remove the disabled class using javascript from withing the HTML component

Here is part of my code(that works outside of Appery) Any ideas?

function enableOrDisableSubmit(val) {
//if the val parameter is greater than or equal
//to 6, and the val is also not whitespace --
if (val = 6) {
//remove the disabled attribute--
$('#submit').removeAttr('disabled');
} else {
//add/rewrite/overwrite the disabled attribute--
$('#submit').attr('disabled', 'disabled');
}
}
});//]]

Code: Select all

          span0/span

change class of button within html component

Posted: Tue Nov 03, 2015 6:31 pm
by Serhii Kulibaba

Hello Vinny,

You have to use method "removeClass", instead of "removeAttr"


change class of button within html component

Posted: Wed Nov 04, 2015 1:06 am
by Vinny B

Thank you it help allot.