Via JavaScript, PHP, or HTML. I want to do this to check if a username is allowed (on our side).
Sorry for not elaborating too much. If the username is too short, a message will appear next to it (I will do this part) saying that it is too short, but for this to be done automatically I would need for it to be detected.
<script type="text/javascript">
document.getElementById('username').onchange=userCheck;
function userCheck() {
document.getElementById("usercheck").innerHTML="kk";
}
</script>
<form action="devlabs.php">
Username: <input type="text" id="username"/><em id="usercheck"></em>
</form>
What you are looking for is the onChange
event. For example, if you were using prototype.js, the following would do the trick:
$('usernameFieldId').observe('change', usernameValidaitonFunction);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With