facebook

Combo boxes and fields like SSN, Height and Weight

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #339945 Reply

    Pauldivaniii
    Member

    I am setting the current “State” (as in California, Alabama) in my combo box to a default value. That is working but when I see the screen in the Test Center it shows me the default set on the form. When I go to set the value the item I set programmatically is actually set but it is not scrolled into position. Is there something I have to set in order to scroll it into position on the list? My initialization code looks like this:

    $(‘select[name=”cbOfficerState”] option:contains(“‘ + officerState + ‘”)’).attr(‘selected’, true);

    On another note, my customer wants me to set the input format so that they can enter in basically numeric text strings, like height (5’10”) and weight (146 lbs) as well as social security numbers and other fields that are primarily numeric. I can’t use number

    And lastly: Is there a way to exit the application. When I press the End App button on the iPhone the phone goes back to the Application list but when I pick the app again it comes up where it was the last time. I would at least like to respond to some kind of lost focus event that would allow me to reset the application to the first page.

    Thanks and sorry for the long list.

    #339974 Reply

    Hi Paul

    Next snipet should be helpful for you.

    $(‘select[name=”combobox1″] option[value=”valueX“]’).attr(‘selected’,’selected’)
    phoneui.preprocessDOM(‘#m1-<screenName>‘);

    You need to change the highlighted values.

    #340456 Reply

    Pauldivaniii
    Member

    Thanks for the hint on refreshing the page to make the selected item sync up with the setting.

    On my other question: How do you exit/close the application from within the application? I haven’t figured out a way to do that. Or how do you detect when the Home button has been pressed on the phone so I can try a window.close(); call?

    Thanks

    #340471 Reply

    Hi Paul,

    Apple does not believe that an app should programmatically exit. Thus iOS does not include an exit api.

    #340473 Reply

    Pauldivaniii
    Member

    Thanks, now is there an event to respond to in order to determine when your application is the active application so you can reset it? That way I can at least reset the application so it looks like it restarted.

    #340515 Reply

    Hi Paul,

    Take a look at deviceready and resume: http://docs.phonegap.com/en/2.2.0/cordova_events_events.md.html#Events

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: Combo boxes and fields like SSN, Height and Weight

You must be logged in to post in the forum log in