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

#1 saSBH2   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.

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


<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'">


registerform.html is a page I want to go.
and this is my validation.js
function gopage(){
	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   User is online

  • 痛覚残留
  • member icon

Reputation: 4201
  • View blog
  • Posts: 13,273
  • 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