Page 1 of 1

redirect with radio button

Posted: Wed Sep 07, 2005 9:10 pm
by vchris
Hey!

Is there anyway I can redirect a user to a certain page when he clicks on the radio button without clicking a submit button in php?

I managed to do it with javascript. In php would be the best.

My javascript code:

Code: Select all

function modifycontact() {
   location = "contactlist_mod_admin.php?cid="+document.contactlistform.modify.value;
}

Posted: Wed Sep 07, 2005 10:00 pm
by feyd
you could have javascript submit the form, that's the only way php will get involved..

Posted: Thu Sep 08, 2005 12:53 am
by josh
He could do something like:
onChange="document.myIFrame.location='/myscript.php'"

and he could have myscript.php output:

Code: Select all

parent.location='/newpage/';
Edit:
viewtopic.php?t=37881

double post?

Posted: Thu Sep 08, 2005 8:37 pm
by vchris
Yes jshpro2 it's kind of a double post but I thought it's a question about php code not javascript so that's why I posted here.

So there is no simple way to do this only using php. I guess I'll stick with javascript for redirecting.

Thanks