1 reply [Last post]
Armandt
Offline
newbie
Last seen: 16 years 5 weeks ago
Joined: 2004-03-05
Posts: 1
Points: 0

Hi there!
I'm trying to create a function that will open another page. But the target of that page must be self or blank or what ever!!
This is my function

function checkForm(form)
{
if(form.agree.checked == false){
document.location = 'Please_Check.html';
return false;
}
return true;
}

Please help!!

Tags:
Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 1 day ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5342
Points: 2963

document.location

Hi Armandt,
I think your after window.open that is if you wish to have a new window open.

 
function checkForm(form) 
{ 
if(form.agree.checked == false){ 
window.open( 'Please_Check.html', 'check'); 
return false; 
} 
return true; 
} 
otherwise use location.href='Please_Check.html';

Hope that helps