I am using this code for accessing the attribute of the button throught the id of one of the form fields.. but it isn't working..
$(document).ready(function() {
if (document.getElementById("idadminusername").style.color == 'red') {
$("#btn").attr("disabled", "true");
}
}