最近搜索


没有最近搜索

Using Zendesk placeholder in Help Center

已回答


已于 2022年8月05日 发布

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 条评论

Hi Foad,

Are you waiting until the page is fully loaded when executing that line of code?

0


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


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


请先登录再写评论。

找不到所需的内容?

新建帖子