I’m working on a date-field validator, and I find I need access to the actual, raw text entered by the user. Unfortunately, I can’t seem to find it.
Here’s what I’ve got:
- standard Date field displayed on a Form
- Fragment’s “Validator” setting pointing to my new Fragment Validator
- User (me) enters 12345, obviously not a valid date
Within my Validator is this code:
// retrieve the input string
let input_string = fragment_presenter.get_value();
cs.log('input string = ’ + input_string);
In the Detective I get this:
11:36:38.1686 input string = 1969-12-31 00:00:00
Obviously, not what I want since this looks very much like a valid date.
Changing “get_value” to “get_displayable_value” yeilds this
11:38:34.8434 input string = Wed, 31 Dec 1969 (occurred 4 times)
So, is there a way to get the raw, un-processed text string from a date (or any other) Fragment?