Jump to content

using input radio to choose applet to load


j0hn

Recommended Posts

ok so im a bit stuck here, pretty new to all this

ive searched the forum before i posted, but found nothing similar

 

i want to make an input radio button choose between 2 different applets

i was thinking of making each radio button simply comment out its opposite <applet> code

would that work? so far i have:

 

Applet 1 <input type="radio" checked name="c1" value="">
Applet2 <input type="radio" name="c1" value="">

<applet>applet 1 code goes here</applet>
<applet>applet 2 code goes here</applet>

my thoughts were to simply add $FORM{'c1'} to the beginning of the <applet> code, to comment it out

like:

$FORM{'c1'}<applet>applet 1 code goes here</applet>
$FORM{'c1'}<applet>applet 2 code goes here</applet>

that way i could set the radio buttons to make a value of "#"

 

i dont even know if that would work! problem i see is it would comment out both.

any advice? or a better work around?

thank you in advance :)

If you are using PHP why not do this

 

Applet 1 <input type="radio" checked name="c1" value="1">
Applet2 <input type="radio" name="c1" value="2">

if (isset($_POST['c1'])) {
    if ($_POST['c1'] == 1) {
           print '<applet>applet 1 code goes here</applet>';
    }elseif ($_POST['c1'] == 2) {
           print '<applet>applet 2 code goes here</applet>';
    }
}

 

--FrosT

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.