Skip to main content
nbkfysc
Participating Frequently
December 30, 2015
Question

Text Entry Box- Validate today's date using Conditional Action

  • December 30, 2015
  • 1 reply
  • 247 views

Hello,

I am trying to get a text entry box to validate to today's date. The way I've tried so far is to uncheck the validate user entry button on the Text Entry Box settings.

Then, I wrote a simple advanced action where:

v_user_input is a variable that simply stores the TEB user input

v_hidden is a variable that stores today's date

1st Decision-

If 1 is equal to 1, Assign variable "v_hidden" with cpInfoCurrentDateString

My idea is this will "Store" today's date from the users' computer in the variable. This then allows me to perform the Conditional part of the script.

2nd Decision-

If v_hidden is equal to v_user_input then jump to success slide.

For some reason this works only about half the time when I preview in browser. Can you please tell me if I'm crazy or if there's some way to make this work to validate today's date?

Justin

This topic has been closed for replies.

1 reply

RodWard
Community Expert
Community Expert
December 31, 2015

Text input into a TEB gets treated as a string, not a number or a date.

How are you triggering the Conditional Action?  I suggest you use the On Success action of a button and make it look like this button has to be clicked to Submit the TEB entered data.  Your issue with the current action only working half the time could be due to the way TEBs only expect to be used once per slide.

nbkfysc
nbkfyscAuthor
Participating Frequently
January 5, 2016

Thank you very much for the reply Rod!

I am trying to use the "On Success" of the TEB to trigger the advanced action. I set the TEB to not validate user input, thus "by-passing" the validation by the TEB. It sounds like this may be the issue with it only working sometime. If the user submits an incorrect answer, the TEB is 'used up' and thus won't re-submit?

I searched high and low to try and figure out how to get it to validate to "today's date," so if there's a better way I would LOVE to learn.

Lilybiri
Legend
January 5, 2016

You could rewind the playhead one frame back, to be again before the pausing point of the TEB.