How to get the value of what is written in a form and not on the table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2023 07:03 AM
Hi everyone, Im using the "form" widget, where I have a "message" field and a "resolve" button.
What is happening:
When I click resolve it looks at the value of the "message" field in the table and it's not empty, the state goes to "Closed Completed".
What Im trying to do:
When I click resolve it looks at what is written in the "message" field and not on the table, and if it is empty we get an infoMessage "Message is empty" and if it not empty the state moves to "Closed Completed".
The problem is that I dont know the code to get what's written on the field instead of what is in the table ...
Can anyone help with this ?
Image of the portal:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2023 02:17 AM
Hello @F_bio Santos
g_form.getValue('message');
and check whether it is empty or not.
it should be written on the UI Action.
Plz mark my solution as Accept, If you find it helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2023 07:32 AM
The problem with this is that it gets what's on the table @Samaksh Wani I want something that get's what the using is writing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-26-2023 03:05 AM - edited ‎10-26-2023 03:05 AM
Here is the catch:
For the HTML fields, the text generally is considered as "paragraph" therefore your text is read as "<p>yourText</p>"
Check this onLoad script:
//Type appropriate comment here, and begin script below
var abc = g_form.getValue("u_html_1");
g_form.addInfoMessage("abc");
if (abc == "<p>AniketBhanse</p>") {
g_form.addInfoMessage("true");
}
else {
alert("false");
}
This script returns "true" even when the text written on the form is "AniketBhanse"
In your case, you will have to adjust your script in such a way that the script is considering the HTML tags as well (like paragraph, heading-1,heading-2 etc)
Please mark it as correct or check if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2023 12:06 AM
if your issue is resolved from the above script, please mark an answer Correct. This way the thread will be closed and it will help other users too.
Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!