Auto populating custom fields | Community
Skip to main content

Auto populating custom fields

  • September 19, 2019
  • 2 replies
  • 0 views

So I have created a custom field called introductions in order to provide some narrative to a customer on why they are filling out certain fields on a ticket form.

The custom field is called introductions. I want this field to be populated with "This field is left intentionally blank". I have had luck with hiding and pre populating the subject and description fields but cannot get the code to work for the custom fields.

}
var ticketForm = location.search.split('ticket_form_id=')[1];
if(ticketForm == 360000065797) {
$('#request_subject').val('Introductions');
$('#request_description').val('Customer primary contact details');
$('#request_subject').parent('.request_subject').hide();
$('#request_description').parent('.request_description').hide();
$('#request_custom_field_introductions').val('This field is left intentionally blank');
}

What is wrong/missing from the above and is there another way to present a message at the top of a ticket form?

This topic has been closed for replies.

2 replies

Dan32
  • October 3, 2019

Hey David,

Try using the custom field ID, rather than the name of the field. You can find the Field ID in the Ticket Fields setup area in Support admin, next to the field name. 

$('#request_custom_fields_1234567890').val('This field is left intentionally blank');

Hope that helps


  • Author
  • October 8, 2019

Thank you, works perfectly. Is there any way I could get some text to appear when hovering over a field? So I have a few fields on a couple of tickets forms where it would be nice for the customer to view field instructions when they hover the mouse cursor over them. Is that possible and if so, how difficult is that to set up?