Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 14 of 14
  1. #1
    Join Date
    Jun 2005
    Location
    Germany
    Posts
    74

    Question Inputfield - Set Focus

    hi,

    i have 4 inputfields in which the user enters a serialnumber. i set the input mask, so the user can only enter 4 digits in each field.
    is it possible to set the focus on the next inputfield after the 4th digit is entered?

    byte

  2. #2
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Use String.Length in the On Key event to see if the length is == 4, if so Page.SetFocus to the next object

  3. #3
    Join Date
    Jun 2005
    Location
    Germany
    Posts
    74
    hi Worm,

    thanks for the answer. this is what i got.
    Code:
    RegInputSerial1 = Input.GetText("Input_Serial1");
    
    StrLength1 = String.Length(RegInputSerial1);
    
    if StrLength1 == 4 then
      Page.SetFocus("Input_Serial2");
    end
    but it is not working, with a input mask, only if the inputfield is a standard field.

    byte

  4. #4
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Give this a try
    Code:
    --trim out your place holder
    RegInputSerial1 = String.TrimRight(Input.GetText("Input_Serial1"), " ");
    
    StrLength1 = String.Length(RegInputSerial1);
    
    if StrLength1 == 4 then
      Page.SetFocus("Input_Serial2");
    end
    Last edited by Worm; 11-03-2005 at 05:56 AM.

  5. #5
    Join Date
    Jun 2005
    Location
    Germany
    Posts
    74
    kind of works, but if i move the mouse over the inputfields, all numbers disapear.

    byte

  6. #6
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    This seems to work for me. Maybe I missed something in my explanation, or I missed something in yours in how you wanted it to work.
    Attached Files

  7. #7
    Join Date
    Jun 2005
    Location
    Germany
    Posts
    74
    in your example it works fine, but even if i copy your code into my project, it still deletes the number if i move the mouse over the inputfields.

    byte

  8. #8
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    When you move the mouse over the object, or click in it?

    Do you have any other code or objects below with On Enter code?

  9. #9
    Join Date
    Jun 2005
    Location
    Germany
    Posts
    74
    when i move the mouse over the object

    i have 2 buttons below. one of them sends the information to a php script and the other one exits the programm.

    byte

  10. #10
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    There must be some code somewhere with a On Enter or the Page's Mouse events that is doing it. If you can't find it, you can post the app

  11. #11
    Join Date
    Jun 2005
    Location
    Germany
    Posts
    74
    i cant't find anything
    here is the app. maybe you can find out why it is not working.

    byte
    Attached Files

  12. #12
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    That's odd. Works fine here. Are you running the latest rev of AMS?

  13. #13
    Join Date
    Jun 2005
    Location
    Germany
    Posts
    74
    yes i do.

    but if it can't be fixed, i just leave it without the input mask

    byte

  14. #14
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    I don't know what to say, your app does work fine on my system here. There must be something else involved.

Similar Threads

  1. How to put a variabele in a WriteFromString
    By brianlesker in forum Setup Factory 7.0
    Replies: 11
    Last Post: 10-04-2004, 05:44 PM
  2. Focus on Package Checkboxes
    By praveen_v in forum Setup Factory 6.0
    Replies: 0
    Last Post: 11-20-2002, 01:15 PM
  3. HOWTO: Set up an MP3 Playlist
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-24-2002, 11:57 AM
  4. INFO: How to Set the Default Application Directory
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 09-25-2002, 12:02 PM
  5. Default focus in radiobutton and checkbox dialogs
    By duggyfresh in forum Setup Factory 6.0
    Replies: 2
    Last Post: 04-24-2001, 04:01 AM

Posting Permissions

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