Forum Discussion

jyothisita's avatar
jyothisita
Community Member
12 years ago

How to remove an initial value (0) from a "Numeric Entry" field

Hello,

Can anyone know, how to remove an initial value i.e. 0 from a "Numeric Entry" field?

Thanks in advance....

74 Replies

  • Snorrski's avatar
    Snorrski
    Community Member

    You can do a work-around, using javascript and jQuery. 

    First thing is that you need to import jQuery to the browser. You do this with a javascript trigger:

    if (window.jQuery == "undefined") { 
    var head = document.head;
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'https://code.jquery.com/jquery-3.6.0.min.js';
    head.appendChild(script);
    }

    Second you need to add the triggers. If there is only the one numeric input, or of you want to target all input fields in the slide, you can use the code $('input').prop('value', '') .  A better way would be to go through all of them, and check if they have the value "0". Like so:

    $('input').each(function() {
       if ($(this).prop('value') == '0') {
          $(this).prop('value','')
       }
    }

    If the reset button and the input is on the same slide, you can put the triggers in the same button. I.e. Set NumericEntry to value 0 and Execute JavaScript

    If the input(s) is/are on a different slide you need to set the JavaScript to trigger when the built-in variable "Menu.SlideNumber" changes. This will make it trigger each time the user visits the slide, without having to restart the timeline.

    Note that all of this works in Storyline 360, but might not work in other versions. 

  • MikeAdamski's avatar
    MikeAdamski
    Community Member

    This also seems to be tied to any particular variable that is being used. I've created numerous textboxes (with %variable%) and they all show up with a zero. This happens whether they are created new, copied from an existing, etc.

    This is undoubtedly a software issue that is happening still 3 years after this thread was started.

  • When will you fix the problem with the zero?
    at my work we make math quizzes & its a big problem. 
    there's a lot of stuff we cant teach the kids because of this.

     

  • Hello or co,

    Do you know what version of Storyline you're using? 

    • You can check by going to Help > About Articulate Storyline

    It looks like you are using Storyline 3 and the issue shared here was corrected in Build 3.7.20003.0:

    Fixed: Numeric-entry fields displayed default values of zero after renaming their underlying variables. They should remain blank until learners enter values.

    If you're seeing this issue in the latest version, please share your project file with our support engineers. You can share it privately by uploading it here. It will be deleted when troubleshooting is complete.