[jQuery] Grabbing selection from one RadComboBox and sticking in another.
Hello jQuery Experts,
I just joined this group and I am pretty new to development so just
bear with me. (-: I'm very excited to use, and LOVE jQuery. It's
awesome!
Anyway, here's my question. I have some RadComboBoxes from telerik.com
on my web form. What I would like to do is grab the value, or should I
say selection, from one combo and stick it in another. Is that
possible? Below is my code where if the user selects "Same as my
business address" on a radio button list, it takes all the values of
the textboxes and sticks them in the Mailing Address textboxes so the
user won't have to manually type them in. Oh, one more thing, I'm
using ASP.Net 2.0 with Visual Studio 2005. This would be SWEET to get
this to work.
jquery.com, www.telerik.com and www.peterblum.com -- these guys make
me look like I know what I'm doing!! (-:
Radio button list:
<asp:RadioButtonList ID="rblMailingAddress" runat="server"
TabIndex="330">
<asp:ListItem Value="Sameasbusaddr">Same as my business address.</
asp:ListItem>
<asp:ListItem Value="SameasHaddr">Same as my home address.</
asp:ListItem>
<asp:ListItem Value="Separateaddr">This is a separate address.</
asp:ListItem>
</asp:RadioButtonList>
<VAM:FilteredTextBox ID="tbBusinessAddress" runat="server"... from
peterblum.com
<VAM:FilteredTextBox ID="tbBusinessAddress" runat="server"...
<radC:RadComboBox ID="cmbBusinessState" runat="server"... from
telerik.com
<VAM:MultiSegmentDataEntry ID="msdeBusinessZip" runat="server"...
<VAM:FilteredTextBox ID="tbMailingAddress" runat="server" ...
<VAM:FilteredTextBox ID="tbMailingCity" runat="server" ...
<radC:RadComboBox ID="cmbMailingState" runat="server" ...
<VAM:MultiSegmentDataEntry ID="msdeMailingZip" runat="server"...
and so on and so forth...
$(document).ready(function(){
//For Mailing Address information
$('#rblMailingAddress :radio').click(function() {
var CurVal = $("input[@name='rblMailingAddress']:checked").val()
if(CurVal == "Sameasbusaddr")
{
$("#tbMailingAddress").val($("#tbBusinessAddress").val());
$("#tbMailingCity").val($("#tbBusinessCity").val());
$('input[@id=cmbMailingState option:selected]').text($
('input[@id=cmbBusinessState option:selected]').text()); //this is
what I'm trying so far but I know it's not right
$("#msdeMailingZip").val($("#msdeBusinessZip").val());
}
else if(CurVal == "SameasHaddr")
{
$("#tbMailingAddress").val($("#tbResidentAddress").val());
$("#tbMailingCity").val($("#tbResidentCity").val());
$("#cmbMailingState option:selected").text($("#cmbResidentState
option:selected").text());
$("#msdeMailingZip").val($("#msdeResidentZip").val());
}
else
{
//clear 'em out
$("#tbMailingAddress").val("");
$("#tbMailingCity").val("");
$("#cmbMailingState option:selected").text("");
$("#msdeMailingZip").val("");
}
}); //end click for Mailing Addr
});
Thanks in advance...
milliKidd