hari1
In the zone
Please see this html code:-
Whenever I enter text in the text box and press submit, the text case changes but immediately the page also reloads. How do I prevent this reload? Also is there anyway I can do the same thing without any submit button at all? Like as I type the text or paste from somewhere, simultaneously the text case also changes.
Thanks
Code:
<html><head><title>title</title>
<script type="text/javascript">
function change_case()
{
document.form1.type.value=document.form1.type.value.toLowerCase();
}
</script>
</head>
<body onLoad="form1.type.focus();">
<form name=form1 method=post action=''>
<input type=text name=type>
<input type=submit value=Submit onclick="change_case();"> </form>
</body>
</html>
Whenever I enter text in the text box and press submit, the text case changes but immediately the page also reloads. How do I prevent this reload? Also is there anyway I can do the same thing without any submit button at all? Like as I type the text or paste from somewhere, simultaneously the text case also changes.
Thanks