Keeping numerals visible while typing decimal point...

  • A very simple example is here: http://1drv.ms/1QzRcvd

    An educational game I have been developing little by little over several months suddenly started exhibiting problems, and I am perplexed as to why. I am using a Text box (form control, set to 'number' input) to accept keyboard input and then copying these numbers to a text object for displaying on screen. Everything displayed and behaved normally until recently.

    The problem that I think popped up in the last few days is that the 'text' of the TextBox disappears when the number being entered ends with a "." (decimal point). For example, as the user would type in the decimal value "3.42" the text field disappears as the user enters the decimal point after the three. If I change the Properties/Type to "text" everything works fine, but I need it set to "number" because I want the number pad to pop up for the user, not the keyboard. It appears that C2 is suddenly having a hard time recognizing it as a 'number' when it ends in a "."

    I appreciate any and all assistance and really hope to get back on track with my game. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile"> I apologize for wasting anyone's time if I am missing something obvious or overlooked a previous discussion on this matter. I am an educator, not a programmer, but C2 has really given me an exciting avenue to try to reach my students. I'm using this numerical entry for math-based problems in (what I hope is) a fun game for them.

    I have the user enter text in the TextBox, which is seen on-screen every tick as it's displayed in a TextObject. When it comes time to evaluate the user's response I copy the number into a global variable which is used in various calculations and compared to a correct value to determine right/wrong.

  • There isn't a decimal point on number pads is there? So you should be fine in the end environment.

  • It seems Chrome returns an empty string for number inputs that end in a decimal point. I don't know what you can do about that. I don't think there is any way to force the numeric keyboard with a text input. You could use the telephone input but that's not ideal.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thank you both for your replies, Ramones, I really appreciate your expertise in knowing that about chrome, as I am still at such a beginning phase I wouldn't have even thought to address it at the "browser-level." Strange that it only started happening recently, as I have been using chrome for quite a while.

  • I see some other people mention the same issue and it looks like it only started in Chrome 47.

    https://productforums.google.com/forum/ ... 7Zqe7-sLOY

    https://productforums.google.com/forum/ ... UtAQoIF0Y8

    Hopefully it's just a temporary issue that gets fixed soon.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)