最近搜索


没有最近搜索

APIv4: How to hide the organization field on contact form



image avatar

Bryan

Zendesk Luminary

已于 2024年10月31日 发布

Hi all! I just updated my help center theme from APIv2 to v4 in order to get greater form customization options. But I'm currently finding it more difficult. Hoping to find some advice.

In particular, I need the organization field on the contact form to be hidden. The customer's default organization is fine to pass through. But they don't need to see other organizations if they're part of more than one.

Ideally, it would be great if the field ID was added as a class for the div that contains each form field. But I'm struggling to make sense of the new js assets that are in the latest Copenhagen theme. Can anyone point me in the right direction for this?


0

3

3 条评论

image avatar

Jakub

Zendesk Customer Care

You can achieve it with React with this prompt in the new_request_page.hbs

props.requestForm.organization_field = false;

 

1


image avatar

Bryan

Zendesk Luminary

Amazing! Thank you sir.

0


How can I pop an alert in a certain field equals a value on change?  tried this:

 

document.addEventListener("DOMContentLoaded", function() {
   // Check if the value in props.requestForm.ticket_fields[256] is "No"
   if (props.requestForm.ticket_fields[256] && props.requestForm.ticket_fields[256].value === "no_rejects") {
       // Trigger the alert
       alert("The value is 'No'. Please take necessary action.");
   }
});

 

but doesn't work….

0


请先登录再写评论。

找不到所需的内容?

新建帖子