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>
use javascript to handle a DOM event for that input. see here for a list.
Maybe use onkeypress like this:
< input type=”text” onkeypress=”alert(‘you pressed a key’);” / >
Use a variable if you want to track its old value and compare. Here is an example using onkeypress.