its because your code is wrong.
try the following
Code:
<html>
<head>
<script type="text/javascript" language="JavaScript">
function asd() {
//you got the control ok but not getting the value when the user clicked this is correct
var a = document.getElementById('text1').value
if (a.indexOf("q") > -1) {
//no clue why you were escaping your !
alert("Sent ! ! !")}
else {alert("Sorry Invalid Entry")}
}
</script>
</head>
<body>
<input type="text" id="text1"><input type="button" onclick="asd()" value="Send">
</body>
</html>
Bookmarks