hi,
Firstly you have missed the .val();
// Also declare a global flag to keep track of button state, whether it is enabled or disabled.
code
var btnSignInEnabled = true;
/code
code
var x = Apperyio("txtUN").val().trim(); // Trim to remove spaces
var y = Apperyio("txtPW").val().trim(); // Trim to remove spaces
if ((x.length > 0) && (y.length > 0)){
if (btnSignInEnabled !== true) { // If button is not enabled, enable it
btnSignInEnabled = true;
$("[dsid='btnsignin']").removeClass('ui-disabled');
}
} else {
if (btnSignInEnabled !== false) { // If button if not disabled, disable it
btnSignInEnabled = false;
$("[dsid='btnsignin']").addClass('ui-disabled');
}
}
/code
Use the above JS code in the "Input" event of both txtUN and txtPW
And ya in the beginning remember to call this event once, upon page show event. Because in the beginning your input boxes will be empty and you want the sign in button to be disabled.