playMaker

Author Topic: UGui Input Field On Submit Event  (Read 1257 times)

iEpic

  • Playmaker Newbie
  • *
  • Posts: 48
    • IndieGamerWorld
UGui Input Field On Submit Event
« on: February 27, 2017, 06:51:56 PM »
This says it only fires when the user presses enter, and not if the field looses focus, but it's always sending the event if I click out of the box or click anywhere else.

I need to only send the even when they press enter, because it uploads a string to a SQL database and if they try to cancel it, it still sends the event when they get out of the field's focus.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: UGui Input Field On Submit Event
« Reply #1 on: February 28, 2017, 08:40:35 AM »
Hi,

 to cancel a input field, the user has to press "esc" key, else if the user click somewhere else, it's treated as a submit, this is by design inside uGui.

 if you want to prevent this, you should simply check if the enter key is down when submittion occur.

else, check out the sample uGuiLoginForm, it has a check routin for enter key on a field to login on user enter key instead of pressing a button, that could give you some ideas.

Let me know if that creates problem for you.

 Bye,

 Jean