- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 08:20 AM - edited 09-06-2023 12:05 AM
Hi,
I have a requirement, when status is retired or transferred then Hosting information(u_what_type_of_3rd_party_hosting) field need to be read only but I have other requirement so based on that i have written this code.
This script will make the field editable based on selecting the value from other field...but now when the status is changed to retired or transferred then the field needs to be readonly.....On top of the script i have added if condition it works (field became readonly) but throwing an error near the on change field.
What is the best way to achieve this.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 09:17 AM
@suuriya change line number 9 and 10 to below
var status = g_form.getValue('install_status');
if(status!="270")
Basically to explain in a simple way you need to use get Value to access some field value on form and you cant write the field name directly like install_status .In your script in line no 9 you directly wrote install_status which script cant recognise as there is no such thing called install status.
But when you change it to above script which i gave ..i used get value and stored it in some variable and used that variable in if statement to compare the value .
Hope this helps
Mark the answer correct if this helps you
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 08:26 AM
Hello @suuriya ,
can you please paste the entire screenshot of the error .In the image that you provided top part is missing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 08:37 AM - edited 09-06-2023 12:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 08:40 AM
@suuriya ,
you must have used "install_Status" field name directly in your script instead of g_form.getValue('install_status');
try replacing it with above and the error might go away.
Hope this helps
Mark the answer correct if this helps you
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 09:11 AM - edited 09-06-2023 12:06 AM