Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<script type="text/javascript">
function doSelect(el){
sel = el.options[el.selectedIndex].value;
    if(sel == "-"){
        alert("Please choose an option");
    }
    else{
        el.form.submit();
    }
}
</script>
<form name="form1" method="post" action="">
  <select name="select" onchange="doSelect(this)">
    <option value="-">Choose</option>
    <option value="item1">item1</option>
    <option value="item2">item2</option>
  </select>
</form>
<?php
if(isset($_POST["select"])){
$prom=$_POST["select"];
echo $prom;
}
?>
Output 300px

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers