Recent searches
No recent searches
Using Zendesk placeholder in Help Center
Answered
Posted Aug 05, 2022
Hi,
I want to pre fill the subject field with username and form name. Is this possible ?
I have the following snippet, but have tried every iteration of placing the required placeholder to no avail.
$('#request_subject').val('hello world'); // Autofill subject
Please help
0
3
3 comments
Jack
Hi Foad,
Are you waiting until the page is fully loaded when executing that line of code?
0
Foad Izagaren
Does the ticket need to be submitted ?
The above code works.. however the 'hello world' is static .. I would like this dynamic and to include the username / form name
0
Jack
Apologies, I misunderstood! You can get the users name (if they are signed in) from HelpCenter.user.name (try type it into the console when viewing your HC to see what I mean) but for the ticket form name it’s possible but you’d probably either need to read the value from the issue select drop down (if you have more than one form and it asks the user to select one) or by reading the ticket form id and hard coding a value to it? Those are some ideas you could use
0