how can i change selected value of drop list dynamically
- by Deepak Gupta
i want to pick the value from text box and then change the value of dropdown list according to that value
<html>
<head>
<script>
function change()
{
var value = document.getElementById('text').value;
document.getElementById("Model").selectedvalue = value
}
</script>
</head>
<body>
<asp:DropDownList ID="Model" AutoPostBack="false" runat="server" CssClass="styled">
<asp:ListItem Value="None">None</asp:ListItem>
<asp:ListItem Value="Enum">Enum</asp:ListItem>
<asp:ListItem Value="Sum">Sum</asp:ListItem>
<asp:ListItem Value="Multi">Multi</asp:ListItem>
<asp:ListItem Value="Xaxis">Xaxis</asp:ListItem>
</asp:DropDownList>
<input id="text" type="text"/>
<input type="button" onclick="change();"/>
</body>
<html>