Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

[Help]Combobox

General discussions related to php

Moderators: macek, egami, gesf

[Help]Combobox

Postby solid2005 » Sat Oct 13, 2012 5:22 am

Code: Select all
<?php
echo '
<script type="text/javascript">
function showSelection(_vipselection){
if (_vipselection > 0) {
if (_vipselection == 1){
_vipValue = _vipselection;
_vipselection = "Bronze";
location.href="test.php?_vipselection=" + _vipselection;
}else if (_vipselection == 2){
_vipselection = "Silver";
location.href="test.php?_vipselection=" + _vipselection;
}else if (_vipselection == 3){
_vipselection = "Gold";
location.href="test.php?_vipselection=" + _vipselection;
}else if (_vipselection == 4){
_vipselection = "Platinum";
location.href="test.php?_vipselection=" + _vipselection;
}
}else
exit();
   }
</script>';

echo '   <select name="VIP_TYPE" onchange="showSelection(this.value);">
      <option>Select a VIP Type</option>
      <option value="1">VIP-Bronze</option>
      <option value="2">VIP-Silver</option>
      <option value="3">VIP-Gold</option>
      <option value="4">VIP-Platinum</option>
      </select>
        <br/>
      <select name="VIP_DAYS" onchange="showCost(this.value);">
      <option>Select a VIP_Days</option>
      <option value="1">1 Day</option>
      <option value="2">3 Days</option>
      <option value="3">7 Days</option>
      <option value="4">1 Month</option>
      </select>';

echo "<h1>Value is:</h1>";
echo "vipselection  : ".$_GET['_vipselection']."<br>";
echo "vipselection  : ".$_GET['_vipselection']."<br>";

?>

How can i focus the combobox when i choose. example when i select silver it will post that i get silver when my combobox has been refresh i can't continue the next step of registration.
solid2005
New php-forum User
New php-forum User
 
Posts: 1
Joined: Sat Oct 13, 2012 5:19 am

Return to PHP General

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.