Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

radio buttons... url does not change

Status
Not open for further replies.

teky

Programmer
Mar 24, 2000
55
0
0
US
I am using the following javascript function to access radio buttons. When the first radio button is clicked and the user clicks on submit... its goes to yahoo.com in a new window . But when I select the second radio button ... and click submit ... it stays at yahoo.com in the window instead of cnn.com. Please let me know how to correct this and to change to the appropriate url when we select teh radio button and click submit.

Thanks for ur help in advance,
Teky.

function setAction()
{

if (document.portalList.plan[0].checked == true)
{

document.portalList.action += '
document.portalList.submit();

}

else if (document.portalList.plan[1].checked == true)
{

document.portalList.action += '
document.portalList.submit();

}

else if (document.portalList.plan[2].checked == true)
{

document.portalList.action += '
document.portalList.submit();

}

else if (document.portalList.plan[3].checked == true)
{

document.portalList.action += '
document.portalList.submit();

}

}

// -->
</SCRIPT>
 
The problem might be +=. Try this instead

document.portalList.action = '
FYI, += means to add the right-hand expression to the left-hand expression. With strings it means to concatenate.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top