This is a silly question but for the life of me i cannot solve it. i have this coding in my jsp file. <html> <head> <script language="JavaScript" src="Header.js"> </script> </head> <body> <form name="login" onsubmit="return checkPassword(document.login.username.value, document.login.password.value);"> Username: <input type=text name="username"><p> Password: <input type=text name="password"><p> <input type=submit value="Submit"> </form> </html> in the Header.js i have declared the function checkPassword like so.. function checkPassword(oldpass , newpass) { alert(oldpass) alert(newpass) } The odd thing is it never enters this function when i click submit what's wrong
Hey! Know what! Your code runs perfectly on my machine. I can't see any reason why it wouldn't on yours. Well, I didn't post to tell you that. Actually, you could try
Anyways, your code DOES WORK. Well, if the above doesn't work either, consider your machine to be possessed
Cheers!!!
shreehari Gopalakrishnan
Ranch Hand
Joined: Jun 01, 2004
Posts: 30
posted
0
Hi rathi
I also got the same result as anand It is working perfectly
I want to turn this discussion to an another direction why this happens?
why two JScript code runs differently in different machine ?
I doubt that there will be some simple careless mistake from U
by misspelling the file name etc
any way try putting this code with out Header.js file
Hi Rathi, Well in jsp this doest not work , but if you run in simple making html file and call your header.js file it would work perfectly , but in case of jsp it doesnt work so to call anyother javascript file you have to use <%@ include file="header.js%> and now you can call the method of this javascript file . It run sperfectly i tried also. I hope this would work. Thanks. Jasbir