User Tag List

Results 1 to 8 of 8

Thread: Limit EditBox input

  1. #1
    No Products Registered

    Join Date
    Jun 2006
    Posts
    1,630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Limit EditBox input

    Is there any way to limit what is acceptable by the EditBox object as input? I mean, accept only numbers or only letters from A to Z, no special characters, etc...

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,365
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: Limit EditBox input

    Take a look at this

  3. #3
    No Products Registered

    Join Date
    Jun 2006
    Posts
    1,630
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Limit EditBox input

    Perfect! Thanks Popcorn!

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jul 2006
    Location
    USA
    Posts
    658
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Limit EditBox input

    If you have MMF2 Dev, you can use the Masked Edit object.

  5. #5
    No Products Registered

    Join Date
    Jun 2011
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would love to see the example, but the link does not work for me - is there another link?

  6. #6
    Clicker Fusion 2.5 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2009
    Location
    Louisiana, USA
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have two issues. First is the line inside the box. Before typing any text there's a line like underscore a few characters wide. Second issue is the box cannot be tabbed to like an editbox. No tabstop capability.

  7. #7
    Clicker Fusion 2.5 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2009
    Location
    Louisiana, USA
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've done some tinkering around in MMF and figured three ways of dealing with limiting numbers:

    1. Editbox
    2. Masked Edit Object
    3. Numeric Up-Down Object

    For editbox, you have to basically have the app do what another object or what even Windows normally does for you. First set editbox to read only at start of frame. Then create the condition of:

    Upon pressing "0"
    Editbox 1 have input focus

    Then the action for that set of conditions under the editbox is:

    Set Alterable Value A to EditValue("Editbox 1")
    Set text Str$(Alterable Value A( "Edit Box 1" ))+"0"

    You will have to create this event for all the numbers, 0-9, and changing the value of "0" to that number for each respective event. You will also have to create the same events for use with the number keys on the numbers keypad. The conditions will look like this:

    Upon pressing "0 (Num keypad)"
    Editbox 1 have input focus

    Since it's read only the user cannot backspace if they mistype a number. Now you have to create an event to allow the user to backspace.

    The condition for the backspace is:

    Upon pressing "Backspace"
    Editbox have input focus

    Action for condition under Editbox is:

    Left$(Edittext$( "Edit Box 1" ), Len(Edittext$( "Edit Box 1" ))-1)

    If you choose to use Masked Edit Object, my two beefs are that there's an underscore in the box as well as there appears to be no tabstop ability. My workaround for no tabstop is to create a condition where if the input focus is the edibox before the Masked Edit Object and the tab key is pressed, then set input focus to the Masked Edit Object.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,365
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    This is very possible, and my example was indeed made with mmf2.

    Oldlongdragon, this is the second time in a few days you have asked or said that i am not using mmf2. Please stop doing that. This post is 5 years old, and the link is not working any more.

    I might have the example somewhere. I will look for it when i come back home from holiday. It was an effective way of doing this. Kracker's method works, but is not very coder-friendly as you'll ned one event per key. I would use fastloops to scan a list of valid letters.

Similar Threads

  1. iOS Single Line Editbox..focus and limit..
    By Earl in forum iOS Export Module Version 2.0
    Replies: 7
    Last Post: 6th May 2014, 10:46 AM
  2. Keyboard input vs player control input
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 22nd August 2013, 10:00 PM
  3. Cannot input Japanese in Editbox with Google IME
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 9th May 2010, 07:12 PM
  4. Editbox
    By Johnny in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 26th September 2007, 10:00 PM
  5. Editbox - Check for legal input
    By Popcorn in forum File Archive
    Replies: 1
    Last Post: 19th February 2007, 05:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •