Custome Javascript to update a text box not working on Display form

  • 30 October 2017
  • 3 replies
  • 52 views

Badge +1

Hi All,

I am having a form with multiple sections. This sections have a show/hide logic rule based on a text field. So e.g. if text field has value A then section A would be shown and so on.

Button click has a custom javascript to set this textbox with proper value. I have stored client ID of textbox in a variable and using NWF$ to set the value.

All works as expected in new and edit form but I have an issue in display form. As its a textbox it is disabled in display so javascript is not able to set value. I tried below approaches to overcome this issue

1. Using javascript variable which holds client ID of text box, show and enable text box.

2. Give class to textbox and use JQuery to find element so it can be shown and enabled.

But both fails it seems element cannot be found in display form with above two approaches. Can someone help me please.


3 replies

Userlevel 5
Badge +14

configure text box control's 'Control Mode' to Edit instead of enabling control from javascript

210163_pastedImage_1.png

text control‌ ‌ view form‌ control mode‌

Badge +1

Thank you so much. Works like a charm! :-) 

Badge

Thanks Alot for A2A it saved alot of effort

Reply