Forums

redirecting to a page based on form response

rodsdesign 17 Sep, 2008
Hi all (Max)

I need to redirect users to different pages based on their response to one question. (radio button)

What's the best way to do that please? (sorry - i've searched for 1/2 hour😟 )

ie:
Do you like:
a. dogs
b. cats

thanks
Max_admin 17 Sep, 2008
Hi Rod,

use this in the onsubmit after email :

if(JRequest::getVar('radio_input_name') == 'dogs'){
$mainframe->redirect('www.dogs.com');
if(JRequest::getVar('radio_input_name') == 'cats'){
$mainframe->redirect('www.cats.com');


Regards

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
rodsdesign 17 Sep, 2008
hmmmm i can't seem to get it to work...

so here is my exact code:
<input type="radio" name="radio0" value="Yes"> Yes<br>
<input type="radio" name="radio0" value="I've said yes before"> I've said yes before<br>
<input type="radio" name="radio0" value="I'm not ready"> I'm Not Ready<br>
<input type="radio" name="radio0" value="Just checking this out"> I'm Not Ready<br>
<input type="radio" name="radio0" value="I need more information"> I need more information<br>

<br>

<input value="Submit" name="Submit" type="submit">


in the after submit code box:
<?php 

if(JRequest::getVar('radio0') == "Yes"){
echo 'Yes!';
$mainframe->redirect('www.apple.com');
if(JRequest::getVar('radio0') == "I need more information"){
$mainframe->redirect('www.microsoft.com');

?>


just testing 2 until i figure it out...

thoughts?
Max_admin 18 Sep, 2008
Oh, sorry, I made a typo, here is the code :


if(JRequest::getVar('radio_input_name') == 'dogs'){
$mainframe->redirect('www.dogs.com');
}
if(JRequest::getVar('radio_input_name') == 'cats'){
$mainframe->redirect('www.cats.com');
}

Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
rodsdesign 18 Sep, 2008
I guess I'm having a brain dead week...

when i call a form using the plugin... it brings the form up but it won't forward at all😟

I'm getting a "You are not allowed to access this URL " error...

when I access the form directly - it works just fine.
(but I need it in an article..)

sorry Max... thoughts?
Max_admin 18 Sep, 2008
Hi Rod,

its the mambot issue because its outdated now for the new V3.0, I will post a new mambot at the downloads section in the next hours hopefully.

Regards

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
rodsdesign 18 Sep, 2008
thanks Max...

awesome🙂
This topic is locked and no more replies can be posted.