I’m trying to autopopulate the subject line from a dropdown value that the requestor would select from the form. I currently have the code below that is successfully hiding the subject field but the custom dropdown value selected isn’t populating into the subject line. Nothing is actually populating. Right now this code is theoretically inputting the custom value when the Submit button is clicked. Can someone help tell me what I’m missing in my code to get this to work? this is in the script.js tab. Thank you!
//Hide Subject and auto populate with custom field dropdown selection
$(document).ready(function () {
var ticketForm = location.search.split('ticket_form_id=')[1];
var subject_value = $('.request_custom_fields_987654321').val();
if(ticketForm == 123456789) {
$('#request_subject').parent('.request_subject').hide();
$("#new_request").submit(function(e){
$('#request_subject').val(subject_value);
})
}
})