p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Javascript How-To (http://p2p.wrox.com/forumdisplay.php?f=87)
-   -   if radio button is checked (http://p2p.wrox.com/showthread.php?t=27524)

crmpicco March 31st, 2005 07:38 AM

if radio button is checked
 
In my javascript file i have this statement:

If the radio button multileg is checked then i want the page to goto multileg1.asp.

But it doesnt work

Code:

if (document.fexp.multileg.checked==true)
    {
    document.fexp.action ="multileg1.asp"
    }

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt

crmpicco March 31st, 2005 07:39 AM

do u have to end an if statment in js

www.crmpicco.co.uk
www.crmpicco.co.uk.tt
www.milklemonadechocolate.uk.tt
www.griswolds.uk.tt

joefawcett March 31st, 2005 05:10 PM

If you just want to redirect if the box is checked then:
Code:

if (document.fexp.multileg.checked)
{
  window.location = "multileg1.asp";
}

if you want it to submit the form:
Code:

if (document.fexp.multileg.checked)
{
  document.fexp.action = "multileg1.asp";
  document.fexp.submit();
}


--

Joe (Microsoft MVP - XML)


All times are GMT -4. The time now is 05:20 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.