Jump to content

Changing output on selection change


magi

Recommended Posts

Hey everyone, i am creating a calculator liek thing for an online game i run.

 

I asked in the php thread and was told Javascript would be the best choice, however im not familiar with Javascript.

 

What i have is

 

                   

            echo'  <td height="22">Race Selection:</td>
<td height="22"><select class="inputp" name="Empiremenu">';
                                                
if ($_POST[Empiremenu]==1) $s1="selected";	
if ($_POST[Empiremenu]==2) $s2="selected";	
if ($_POST[Empiremenu]==3) $s3="selected";
if ($_POST[Empiremenu]==4) $s4="selected";
if ($_POST[Empiremenu]==5) $s5="selected";
if ($_POST[Empiremenu]==6) $s6="selected";
if ($_POST[Empiremenu]==7) $s7="selected";
if ($_POST[Empiremenu]== $s8="selected";
if ($_POST[Empiremenu]==9) $s9="selected";
echo'<option value="1" '.$s1.'>Dwarven (Lexima)</option>';
echo'<option value="2" '.$s2.'>Imperials (Lexima)</option>';
                echo'<option value="3" '.$s3.'>Shinobi (Lexima)</option>';
echo'<option value="4" '.$s4.'>Templars (Celestial)</option>';
echo'<option value="5" '.$s5.'>Treefolk (Celestial)</option>';
echo'<option value="6" '.$s6.'>Avians (Celestial)</option>';
echo'<option value="7" '.$s7.'>Abominations (Hexion)</option>';
echo'<option value="8" '.$s8.'>Orcs (Hexion)</option>';
echo'<option value="9" '.$s9.'>Snowkin (Hexion)
</option></select></td></tr>';


                if($_POST[1]){echo' g-unit'; }

 

 

What i want to happen is that when i change the option, i want the page to refresh and have the different text there as the unit. However i cannot get either to work so any help would be much appreciated.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.