최근 검색


최근 검색 없음

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


댓글을 남기려면 로그인하세요.

원하는 정보를 못 찾으셨나요?

새 게시물