Pre populate Hidden input from Radio Button Label

This is a jQuery snippet that will populate an input field with the html from a radio button label

 

/////////////////////////////////////////////
// Get the html from the selected Event on the radio button and put it in the hidden field so we can access it in the pdf for the ticket
/////////////////////////////////////////////
$(‘#input_1_1’).click(function(){
var selectedEvent = $(‘form input[type=”radio”]:checked’).parent().next().find(‘label’).html()
$(‘#input_1_9’).val(selectedEvent);
});

Leave a Reply