Solved

Preventing customers from editing ticket fields

  • 2 October 2022
  • 7 replies
  • 240 views

Userlevel 2
Badge

Hi,

 

Is there a way to provide fields which are edible during form submission, but not editable in the ticket view after submission?

 

Many thanks

Chris

icon

Best answer by aravind.sundararajan 3 October 2022, 05:06

View original

7 replies

Userlevel 2
Badge

 

To clarify, I mean “not editable by the customer”.

 

I can see how to prevent agents from editing fields, but this isn’t what we need. We need to stop customers from editing fields after they submit their ticket. 

Userlevel 4
Badge +12

Hello @Chris Denman 

Welcome to the Freshworks Community! We understand the need to prevent customers from editing a field post ticket submission - for example, order ID could be one such field that you wouldn’t want customers changing often. 

At the moment, Freshdesk doesn’t have native functionality that lets you lock the ticket fields post submission. However, we do have the ability to customize the ticket details page to include custom scripts (HTML/CSS, jQuery). 

Here’s a sample script you can add to Admin > Portal pages > Ticket view section to restrict customers from editing certain fields:

<script type="text/javascript">
  jQuery(document).ready(function(){

var fields =['#helpdesk_ticket_custom_field_cf_store_1952170','#helpdesk_ticket_custom_field_cf_rev_status_breach_1952170'];
         
jQuery.each(fields,function(index, value){
 
jQuery(value).attr("disabled",true);

  });
  });
</script>

You can find the corresponding field_ids by doing a browser inspect (console tab) as illustrated in the screenshot below:

 

Hope this helps!

Userlevel 2
Badge

Hi Aravind,

Thanks very much for your reply! This is what we’ve done, but the only issue with this solution is that it wouldn’t prevent a knowledgable user from overriding the JavaScript on the client side. So if there’s a way to log this as a feature request for the future, I’d be very grateful!

Many thanks,

Chris

Userlevel 4
Badge +12

Agreed, @Chris Denman. You can add the request to this topic monitored by our product team!

Cheers!

Many thanks for your response! We've done this, however the main drawback is that it wouldn't stop a savvy user from overriding the JavaScript on the client side. Therefore, I would be very appreciative if there was a mechanism to log this as a feature request for the future.

Userlevel 2
Badge +2

In the Marina theme this doesn’t seem to work anymore?

Badge

Has anybody found a viable workaround? All proposed solutions don't work.

ChatGPT helped me disable most fields starting the script with “document.addEventListener("DOMContentLoaded", function() {“, but it doesn't work with fields in dynamic sections loaded afterwards. 

The customizing options are very frustrating. 

Reply