1 Replies - 605 Views - Last Post: 11 May 2012 - 01:31 PM

#1 saSBH2  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 19
  • Joined: 02-March 10

my code doesn't work in IE

Posted 11 May 2012 - 06:38 AM

Hi, everyone.
I have two questions.

learning.html
<head>
<script language="javascript" src="validation.js">
</script>
<title>Learning </title>

</head>

<body>
<div id="head">
	<h1 id="h1">Learning</h1>
	User Name: <input type="textbox" name="B" id="B" size="10">
	Password: <input type="textbox" name="B" id="B" size="10">
	<input type="Submit" name="Login" value="Login">
	<input type="button" name="Register" value="Register" onclick="window.location='registerform.html'">
</div>
</body>

</html>


registerform.html is a page I want to go.
and this is my validation.js
function gopage(){
	window.location='registerform.html';
	return true;
}


My first question is that, "learning.html" works in firefox but doesn't work in IE. And I want to know why.

My second question is that, if I replace this line:
<input type="button" name="Register" value="Register" onclick="return gopage();">

instead of line 14, then, when I click 'register' nothing happens. while by clicking on it, I want to go to page registerform.html.


Thanks for your helps.

Is This A Good Question/Topic? 0
  • +

Replies To: my code doesn't work in IE

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3572
  • View blog
  • Posts: 10,413
  • Joined: 08-June 10

Re: my code doesn't work in IE

Posted 11 May 2012 - 01:31 PM

try with window.location.href (which is the correct call for a redirect)
Was This Post Helpful? 2
  • +
  • -

Page 1 of 1