Recent searches


No recent searches

Hardcode description for different forms



Posted Oct 24, 2024

Hi

I have 3 forms and would like each one to have a different hardcoded Description.

 

I have the following code already, but this is applied to all forms.

Is there a way to assign a different description by form ID or name similar to below?

 

 $('#request_description').val('System Access Form'); // Autofill description


0

2

2 comments

image avatar

Jakub

Zendesk Customer Care

Hello, 

Yes it is possible to manipulate forms based on their id using the IF stateeent with the field id.

if ($("#request_issue_type_select").val() == "4632445424532") { // Your code for the first condition } else if ($("#request_issue_type_select").val() == "463242424532") { // Your code for the second condition } else { // Code to execute if neither condition is met (optional) // You can leave this empty if you don't need to handle the else case }

0


Hi - sorry for the late response. That doesn't seem to work for me. I took the Form ID from the URL of the form and entered into the code, but the tickets don't display the text I enter in the code.

 

An example of the URL where I get the firm id from is:  ‘https://test.zendesk.com/hc/en-gb/requests/new?ticket_form_id=123456789’

 

The code I used is below:

 

 if ($(""#request_issue_type_select").val() == "123456789") {Account Creation Form} else if ($("#request_issue_type_select").val() == "987654321") {Account Decommission Form} else { // Code to execute if neither condition is met (optional) // You can leave this empty if you don't need to handle the else case }

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post