Question : HTML dropdownllist

I need the Javascript code to set the following dropdownlist using the post value.
$Lvalue = $_POST["XLEW_1_55_1"];
For example if $Lvalue="01". Set the dropdownlis to "UPS overnight"
I try this command ,and dint work
setValue(document.getElementById("XLEW_1_55_1"),"01");
Please if possible send me the correct code.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:

 
Open in New Window Select All Tags: 
HTML PHP
Open in New Window Select All

Answer : HTML dropdownllist

Either do it in PHP

or loop in javascript

 

1:
2:
3:
4:
5:
6:
7:
8:
window.onload=function() {
  for (var i=0;i') {
      document.forms[0].XLEW_1_55_1.options[i].selected=true;
      break;
    }
  }
}
Open in New Window Select All
Random Solutions  
 
programming4us programming4us