KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am checking if user exists in database if exists I am showing message as "existed user" and then I need to disable the signup button if not I need to enable it. I am unable to enable and disable the sign Up button. Can anyone help me in this issue? Here is my code: <script type="text/javascript"> $(function () { $("#<% =btnavailable.ClientID %>").click(function () { if ($("#<% =txtUserName.ClientID %>").val() == "") { $("#<% =txtUserName.ClientID %>").removeClass().addClass('notavailablecss').text('Required field cannot be blank').fadeIn("slow"); } else { $("#<% =txtUserName.ClientID %>").removeClass().addClass('messagebox').text('Checking...').fadeIn("slow"); $.post("LoginHandler.ashx", { uname: $("#<% =txtUserName.ClientID %>").val() }, function (result) { if (result == "1") { $("#<% =txtUserName.ClientID %>").addClass('notavailablecss').fadeTo(900, 1); document.getElementById(#<% =btnSignUp.ClientID %>').enabled = false; } else if (result == "0") { $("#<% =txtUserName.ClientID %>").addClass('availablecss').fadeTo(900, 1); document.getElementById('#<% =btnSignUp.ClientID %>').enabled = true; } else { $("#<% =txtUserName.ClientID %>").addClass('notavailablecss').fadeTo(900, 1); } }); } }); $("#<% =btnavailable.ClientID %>").ajaxError(function (event, request, settings, error) { alert("Error requesting page " + settings.url + " Error:" + error); }); }); </script>
Tags (comma-separated)
Save Edits
Cancel