VertexZero's Forum Posts

  • I tried in both my original file and the one that was corrected. I changed the values from = to

    =3, >=7, and >=10.

    And when the phone number is fully entered and I click to modify, the number I enter goes straight to the end of the number.

  • Yes, the problem is not visible if you correct numbers as you type. But once the number is completed, values changes end up at the end of the number.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When editing though, if lets suppose I would like to edit a number in the middle, it will send it instead to the end.

  • blackhornet Thanks! Didn't see your reply before, sorry.

  • Ah, it was that. I should either drink more coffee or bang my head against a wall hahaha.

    Thanks.

    And sure, what I'm trying to do is to format the phone number input by an user. Its merely for aesthetics, so the user can see if their phone number is correct or not.

    Underneath, we save the phone number as string and use it to connect to an external app.

    Then, in our server, we connect with the app using something like this:

    .../chatbot/stream?userId=%2B12223334444&chatbotId=title

  • yme that works perfectly, thanks! What was the problem with RegexReplace?

    Previously, whenever I added block3, I would get something like (555)(555)(5555)(555)

  • My bad, sorry about that. It should be ok now.

    And I need to format a phone number to (555)-555-5555

    We use the phone number of an user as userID to connect with a mobile app (chatbot).

  • Hey guys,

    I've been fiddling with trying to understand Regex and so far I managed to format a part of a phone number.

    But problems arise when I try to format the last block of the number.

    Any ideas?

    Thanks!

    Below a small .c3p file of what I have so far

    https://drive.google.com/file/d/1-Hvn2LAgtfOoMqcOhjp7jCv5ucHinRF8/view?usp=sharing

  • Actually I found a solution to that:

    RegexReplace(TextInput.Text, "[^0123456789-]", "g", "")

    So I match any character not included in [].

    The problem now is that users can type the "-" symbol as well.

    So I need to figure out how to allow users to type only numbers, and the system format the phone number.

    e.g. (555)555-55555

  • dop2000 For some reason, that didn't work.

    Finally I opted for:

    RegexReplace(TextInput.Text, "\D", "", "")

    But when I try to format the phone number as xxx-xxxx, the symbol "-" is deleted since On Text changed I'm using RegexReplace.

  • Thanks!

  • Hi guys,

    I did a search but I couldn't figure out how to do this.

    I need to be able to enter only numerical values into a text input field (phone number)

    So whenever an invalid character its added (letters or symbols) I need the system to throw a warning.

    Thanks in advance for any ideas.

  • Actually I found the solution. Instead of AJAX on "Value" completed, I set everything to every tick.

  • Hi guys,

    If this question was already asked, my apologies.

    Currently at the company I work, we have connected Construct 3 to our in-house RCS chatbot.

    Now, the link between both it's working well, but I have a small issue:

    Our script updates data sent by the chatbot into our servers and then to Construct 3.

    In c3, we update the data received every tick for now for testing purposes.

    The debug text correctly displays the changes of data, but the basic inventory system I build it's not loading the item into one of the slots. Previously I had tested the Inventory system separately, so I know that works.

    I'm leaning towards the idea that somewhere I'm not parsing or converting the data properly.

    Thanks in advance!

  • Thanks!