redirect with radio button

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vchris
Forum Contributor
Posts: 204
Joined: Tue Aug 30, 2005 7:53 pm
Location: Canada, Quebec

redirect with radio button

Post 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;
}
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you could have javascript submit the form, that's the only way php will get involved..
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post 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?
vchris
Forum Contributor
Posts: 204
Joined: Tue Aug 30, 2005 7:53 pm
Location: Canada, Quebec

Post 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
Post Reply