Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

change class of button within html component

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
Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

change class of button within html component

Hello Vinny,

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

Vinny B
Posts: 0
Joined: Fri Aug 22, 2014 2:22 pm

change class of button within html component

Thank you it help allot.

Return to “Issues”