最近の検索


最近の検索はありません

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


サインインしてコメントを残してください。

お探しのものが見つかりませんか?

新規投稿