当下拉框中的值被选中时,启用文本框


enabling of textbox when a value in a drop down box selected

当我在下拉列表中选择一个选项时,文本框将被启用。我在文本框中输入的值也会保存在数据库中同时在下拉框中选择值

下面是在selectbox上启用文本框选项select的示例代码。

请按要求修改

<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>
使用您的php代码连接和插入数据到数据库。