174
rated 0 times
[
179]
[
5]
/ answers: 1 / hits: 101587
/ 9 Years ago, thu, june 11, 2015, 12:00:00
The code below is supposed to validate the username and password and if correct should run run.html else run fail.html,But the code is not executing as required.What is the error in the code?
<!doctype html>
<html>
<body>
<form>
<font size=5><font color=black><input type=text placeholder=Username name=text1><br /><br /></font>
<font size=5><font color=white><input type=password placeholder=Password name=text2><br /><br /></font>
<font size=5><input type=submit value=Login onclick=javascript.validate(test1.value,test2.value)></font>
</form>
<! javascript>
<script language=javascript>
function validate(text1,text2)
{
if(text1==workshop && text2==workshop)
load(run.html);
else
{
load(fail.html);
}
}
function load(url)
{
location href=url;
}
</script>
</body>
</html>
More From » html