Forum Discussion

StefanieKirs743's avatar
StefanieKirs743
Community Member
17 hours ago

Live Typing +Submit Button Function

Hi Community!

I am working on this project where I have a slide with two text entry boxes. They both have the same setup where they have the exact same "Submit" button at the bottom of each input box. I need help adding the following features to the slide:

  • User can only type in one box at a time.
  • "Submit Note" button becomes Normal when the user starts typing, not when the box loses focus. Otherwise Submit should be disabled.
  • Since user can only type in one box at a time, of course only one Submit button at a time should be enabled.
  • Users should have the option to type in one or both of the boxes in order to advance 

There are already some codes in here but neither of them is accomplishing the above.

Note: Please avoid rearranging other triggers on the slide not related to the objects in question.

Advice? Thanks in advance!

2 Replies

  • DShaw's avatar
    DShaw
    Community Member

    Just from a quick look at it, the two lose focus JavaScript triggers point at variables that don’t exist. The two ‘when timeline starts’ scripts need looking at as they’re a bit of a mess with some duplicate handing of the submit button and other issues in the way they’re trying to grab the text area.. 

  • Hi StefanieKirs743​ I think this is how you wanted it to work. I have also added the character count to the same JavaScript function, so that it updates dynamically as the user types. This is the JavaScript in Timeline Starts.

    You will need to ensure both Submit buttons are set to disabled by default (I have done this in the attached file).

    Confirming the behaviour is:

    • User types in Event Notes
      • Event Notes Submit button
        • Input contains text = Enabled
        • Input empty = Disabled
      • Session Notes Submit button 
        • Always disabled when typing in Event Notes.
    • User types in Session Notes
      • SessionNotes Submit button
        • Input contains text = Enabled
        • Input empty = Disabled
      • EventNotes Submit button 
        • Always disabled when typing in Event Notes.

    I did remove existing triggers I thought were related to trying to make this functionality work, as I had to remove any potential conflicts with the script.

    It's a relatively straightforward script that adds listeners to the input fields and then sets an associated variable (enableEventNotes and enableSessionNotes) in Storyline which then determine if the associated Submit button is enabled/disabled.