Whing Dela Cruz
asked on
Only numbers and letters are allowed
Hi experts, I'm looking for some codes who will disallow or detect any symbols in an input text. I want that in the input text, only numbers or letters is in there, that whenever there's a presence of any of them an alert message will pop-up. Any help please!
<!DOCTYPE html>
<html>
<body>
<input id="idno" type="text"/>
<button onclick="OnlyWordsAndNumbers(document.getElementById('idno'))">Check</button>
<script>
function OnlyWordsAndNumbers(el)
{
//If el is compose of any symbols like @ # ? ! and many others then an alert woulb be..
//Only letters and numbers are allowed in the box.
}
</script>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Welcome, glad that helped.
»bp
»bp
ASKER