Important Update: Archer Community Scheduled Maintenance on November 23–24 - New Community Launching Soon! Learn More..
2020-07-10 12:11 PM
Hi,
We are trying to read the value of text field ( In field options it is text field and not text area) using custom objects like $CM.getFieldValue() by passing correct arguments. But it fails with error that textField.get_value() is not defined function.
As a wordaround I am using $("#textFieldID").html() to get the value but is there more generic way to read it in javascript?
2021-06-23 02:54 PM
Hi David,
Could you give a specific example of how to implement this?
"Yes, that function only works in edit mode. You'll have to use $("#textFieldID") for view mode."
I get "undefined" when I try to access a text field in view mode using this ...
2021-06-23 05:02 PM
@LesIsaacson, easiest way to find out the id is to right-click over the text of the field and select inspect
Ideally you'd do something like this.
$('span[id$="f1569c"]').val();
Replace 1569 with the actual field ID of the text area field and remember that HTML formatting will most likely be returned.
Going forward you should be using variable for any field IDs and better yet use, The Horror's of Moving Custom Objects from One Environment to Another - RSA Link - 569029 so that you don't have to touch the custom object when moving the application from one environment to another.
Advisory Consultant
2021-07-12 10:13 AM
Thanks David, this was very helpful.