Answered

HTML code to hide/display Ticket field

 I despair of finding help! :)


I need to hide/display fields of a "new ticket" form, I manage 2 portals/products, and I don't want the same ticket form for the two portals, Freshdesk support say to me :

1-Add all fields in your ticket form customisation

2-Go in Portals customisation and use HTML code to hide/display the fields.


But no answer after that, the product consultant not reply for the moment

Please if someone (or support) can just say the code needed to hide/display a ticket field ?

Thank you by advance.

Bye


Best Answer

Hello,


You could navigate to the product portal -> portal pages -> New ticket form section and then add the code to hide the fields that shouldn't show up on this portal. 


Here's a sample code that you can use to hide the fields :


<script type="text/javascript">

jQuery('#helpdesk_ticket_custom_field_order_248005').parent().parent().hide();

jQuery('#helpdesk_ticket_custom_field_data_248005').parent().parent().hide();

</script>



The highlighted text is the field ID of the fields that need to be hidden. You can obtain the field ID by navigating to the new ticket page and then doing an inspect using the browser tools.


Here's a screengrab on how to obtain the field ID on the portal :


image



Cheers!



1 person has this question

Answer

Hello,


You could navigate to the product portal -> portal pages -> New ticket form section and then add the code to hide the fields that shouldn't show up on this portal. 


Here's a sample code that you can use to hide the fields :


<script type="text/javascript">

jQuery('#helpdesk_ticket_custom_field_order_248005').parent().parent().hide();

jQuery('#helpdesk_ticket_custom_field_data_248005').parent().parent().hide();

</script>



The highlighted text is the field ID of the fields that need to be hidden. You can obtain the field ID by navigating to the new ticket page and then doing an inspect using the browser tools.


Here's a screengrab on how to obtain the field ID on the portal :


image



Cheers!


Lot of, lot of, lot of thanks .... I will test this and return if work but in advance very thank you !!


 

Thanks,Anjuva :) We shall definitely get this working for you :)

Cheers!