I have 2 Buttons, on a click of a first button i want a value from a listbox to retrieve into textbox .
and click of a second button, the value from a textbox should clear.
this is how i have tried implementing the code, but it doesnt work.
<script type="text/javascript">
$(document).ready(function () {
$('#<%=BtnAddTokenValue.ClientID%>').click(function{
var Value=$('#<%=ListBoxOptionValues.ClientID%>').find(':selected').val();
$('#<%=TextBoxNameValue.ClientID%>').val(Value);
});
});
$(document).ready(function () {
$('#<%=BtnRemoveTokenValue.ClientID%>').click(function(){
$('#<%=TextBoxNameValue.ClientID%>').val("");
});
});
</script>
<table border="0" cellpadding="5" cellspacing="0" style="width: 100%">
<tr>
<td class="style3">
<asp:Button ID="BtnAddTokenValue" runat="server" Text=">" />
</td>
<td class="style2">
<asp:TextBox ID="TextBoxNameValue" runat="server" Width="187px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style3">
<asp:Button ID="BtnRemoveTokenValue" runat="server" Text="<" />
</td>
</tr></table>
thanks for any assistence
There you missed the
()of first click function and its not necessary to calldoc readyhandler two times: