[PLUGIN] focus for textbox

Post your completed addons to share with the community

Post » Fri Mar 23, 2012 10:18 am

While I was making a registration form in construct I couldn't find an easy way to validate a field on the run. So extended the existing textbox plugin with the conditions:
  • On focus lost
  • On focus gain

Focus lost gets triggered when the object was focussed and another object gets the focus.
Focus gain is the other way around. When any other object was focussed and the given object gets the focus.

Download

Hope you enjoy!
B
57
S
3
G
4
Posts: 23
Reputation: 4,219

Post » Tue Apr 10, 2012 2:02 am

Thanks for this, Bicky. I think this is a good one to include in the original textbox.

One thing though, how are you handling focus actions? Like say, returning focus to the canvas after a textbox gets the focus?

Currently, it seems to me the user is forced to press TAB to get back to the canvas, though perhaps I'm missing something.

EDIT: I realize the focus gets returned to the canvas when an OK/Submit button is pressed, but what about in cases where you're not using one? Let's say you're using the ESC key to cancel form entry. Have you or anyone else come across that need?Ugotsta2012-04-10 02:05:07
B
126
S
7
G
4
Posts: 185
Reputation: 7,233

Post » Wed Apr 11, 2012 10:23 am

didn't think anybody would bother with this plugin!

In that case here's a version which works with r85 as well:
Download r85 compatible

About your question Ugotsta:
The focus changes on clicking on the canvas and on clicking on another form element. As well does it change when pressing TAB to go to a next form field.

Only thing not working is pressing ESC, this because the field doesn't lose focus (not in Firefox at least). Adding this feature would be outside of the scope of this plugin. All it does is trigger conditions on focus lost and gain. Not on how one can change the focus.

Hope that helped / clarified.
B
57
S
3
G
4
Posts: 23
Reputation: 4,219

Post » Thu May 02, 2013 4:29 am

hi..what mean focus for textbox?

i was create a registration form, i need of user to fill email and phone number as true validation, while user add wrong format email as exmple, so..user cannot continue and display message as tooltip (maybe)

any one can help me how i can do it
B
7
S
2
G
3
Posts: 13
Reputation: 2,266

Post » Thu May 02, 2013 12:39 pm

when a textbox has focus, you will see the text cursor in it.

if you need to validate an email address or a phone number, you have to it by yourself...
I could add an email check to my textbox plugin, but the phone number is different from country to country...

EDIT: I was wrong, there is a way to determine if a phone number is correct
Anyway, I've added the "Validate" condition to my textbox plugin and it will check if the data you have into the textbox is valid (based on the type you choose from the editor).Pinco2013-05-02 13:31:34
B
11
S
3
G
1
Posts: 35
Reputation: 1,832


Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests