cluster Posted October 14, 2015 Share Posted October 14, 2015 could be a bug ... I was able to check a one letter domain as available 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 14, 2015 Share Posted October 14, 2015 http://forum.whmcs.com/showthread.php?106118-How-to-tell-if-a-domain-is-unavailable&p=436754#post436754 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted October 14, 2015 Author Share Posted October 14, 2015 thanks brian! in my previous WP script I have used some further checks: if(strlen($keyword) > 0) { if(strlen($keyword) < 2) { echo "<font color='#FF0000'>Error: The Domain name is too short.</font></br></br>"; } elseif(strlen($keyword) > 63) { echo "<font color='#FF0000'>Error: Domain name is too long. Max 63 characters.</font></br></br>"; } elseif(!preg_match("/^[a-zA-Z0-9\-]+$/", $keyword)) { echo "<font color='#FF0000'>Error: Domain name cannot contain special characters.</font></br></br>"; } elseif(preg_match("/^-|-$/", $keyword)) { echo "<font color='#FF0000'>Error: Domain name cannot begin, or end with a hyphen.</font></br></br>"; } else ... 0 Quote Link to comment Share on other sites More sharing options...
cluster Posted October 15, 2015 Author Share Posted October 15, 2015 for the moment I could solve the problem with jquery <script src='http://code.jquery.com/jquery-1.7.1.min.js'></script> <input type="text" id="message" value="" /> <input type="button" id="sendButton" value="Send"> <script> $(document).ready(function(){ var checkField; //checking the length of the value of message and assigning to a variable(checkField) on load checkField = $("input#message").val().length; var enableDisableButton = function(){ if(checkField >= 3){ $('#sendButton').removeAttr("disabled"); } else { $('#sendButton').attr("disabled","disabled"); } } //calling enableDisableButton() function on load enableDisableButton(); $('input#message').keyup(function(){ //checking the length of the value of message and assigning to the variable(checkField) on keyup checkField = $("input#message").val().length; //calling enableDisableButton() function on keyup enableDisableButton(); }); }); </script> 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.