Novo_MW
02-08-2004, 11:37 AM
hi
the code below should jump the browser to a new webpage on the click of a button. which website is decided by which radio button is selected.
the code produces no errors and display's correctly, but when the button is pressed nothing happens!
below is an extract of the code minus the html, ive attached a version with the html should it help
your help would be greatly appreachiated
<SCRIPT LANGUAGE="JavaScript">
var flag=0;
function link()
{
if(flag = 0){
window.open('http://www.webpage1.com','_self');
}
else if(flag = 1){
window.open('http://www.webpage2.com','_self');
}
}
</SCRIPT>
<input type=radio name='enable' value='agree' checked onClick=flag=0;>Yes
<input type=radio name='enable' value='disagree' onClick=flag=1;>No
<input type=button name ='button' value="Done!" onClick="link();">
the code below should jump the browser to a new webpage on the click of a button. which website is decided by which radio button is selected.
the code produces no errors and display's correctly, but when the button is pressed nothing happens!
below is an extract of the code minus the html, ive attached a version with the html should it help
your help would be greatly appreachiated
<SCRIPT LANGUAGE="JavaScript">
var flag=0;
function link()
{
if(flag = 0){
window.open('http://www.webpage1.com','_self');
}
else if(flag = 1){
window.open('http://www.webpage2.com','_self');
}
}
</SCRIPT>
<input type=radio name='enable' value='agree' checked onClick=flag=0;>Yes
<input type=radio name='enable' value='disagree' onClick=flag=1;>No
<input type=button name ='button' value="Done!" onClick="link();">