I have this fiddle: https://jsfiddle.net/wbtodgks/2/
jQuery(function($) {
$(".parcelshop").click(function() {
$("#address_lastname").val(this.value); // Put the value into the Amount field
});
});
<input type="radio" class="parcelshop" name="data[shipping_address][address_firstname]" value="95621"> Click me
<input type="text" value="D1" id="address_lastname" name="data[shipping_address][address_lastname]">
And while it works in this controlled setup, I can't get it to work on my site.
I'm getting values from AJAX that populate a DIV - in this DIV I have a radio button for each result. I'm looking for a way to send the value of the user selected radio button to a input field, and I just can't get it to work.
Is it because the way AJAX works, that my javascript doesn't "see" the content of my AJAX output in the DIV?
Any pointers or help would be greatly appreciated. Thanks