Reputation: 13
Ok, I've searched for a while but still haven't found anything that fixes my issue.
I am updating a readonly Textbox in ASP.NET with JQuery after the selection of radio buttons. The value shows up and everything seems to work from an HTML standpoint but Address.Text in the code behind returns nothing.
Also, I've posted all my attempts in the JavaScript section, I know I should only need one of these to update what I'm trying to update.
HTML:
<asp:TextBox class="form-control form-inline" runat="server" ID="Address" placeholder="Populates based off account type" readonly="true"/>
JavaScript:
$(document).ready(function () {
$('input[type=radio]').click(function () {
$('#Address').attr("value", $(this).val());
$('#Address').attr("Text", $(this).val())
$('#Address').val($(this).val());
$('#<%= Address.ClientID %>').val($(this).val());
$('#<%= Address.ClientID %>').text($(this).val());
$('#AccountType').val($(this).val());
});
});
ASP.NET
ClientScript.RegisterStartupScript(GetType(), "myalert", "alert('Address: " + Address.Text + "' );", true);
Thanks in advance to anyone that can help me out.
Upvotes: 1
Views: 1108