选中下拉框中的值时,启用文本框[关闭]

when I selected a option in an drop down list,text box would be enabled.And value I entered in that textbox will stored in database with a value selected in drop down box also.

Below is sample code for enable textbox on selectbox option select.

Please do required changes.

<script type="text/javascript">
function showtextbox()
{
var x=document.getElementById("intext").
x.disabled=false;
}
</script>

</head>
<body>

<form>
<select onChange="showtextbox()"">
    <option >one</option>
    <option>two</option>
</select>
<input type="text" id="intext" name="intext" disabled='disabled'>
</form>

</body>
</html>

Use your php code to connect and insert data in database.