Ok, finally got this to work by modifying the submitForm function so
that it gets my submit button element and focuses on it. I'm still not
happy with this implementation because it is not generic. Currently it
requires every form where I want the keyboard to close to have an
anchor button called "submitButton". Ideally I'd like to be able to
have my own javascript code that the iui submit looks for so that I'm
not hacking the iui files.

Here are the relevant changes in case it helps anyone (this is
certainly not the ideal way, but it works for now):

In my form I have a button named "submitButton":

<a class="whiteButton" id="submitButton" type="submit" href="#">Login</
a>

In iui.js I added this to the top of the submitForm(form) function:

        var submitButton = document.getElementById("submitButton");
        if ( submitButton != null ) {
                submitButton.focus();
        }

David
On Nov 27, 4:28 pm, David  Ethell <[EMAIL PROTECTED]> wrote:
> Here's what I'm trying and it doesn't work yet. Inside the <form> tags
> I have a SELECT tag with style of display:none. I gave it an id of
> "dummyField". Then I modifiediui.js so that the form.onsubmit
> function has this at the top:
>
>         var dummyField = document.getElementById("dummyField");
>         dummyField.focus();
>
> However, that does not see to give the SELECT box the focus and does
> not drop the keyboard.
>
> Any ideas?
>
> David
>
> On Nov 25, 1:40 am, wayne <[EMAIL PROTECTED]> wrote:
>
> > > I tried setting focus to some other page element without success so far, 
> > > ...
>
> > That does work, provided the other element is a non-keyboard input
> > component of the same form or div e.g. an invisible select element.
> > The
> > element will receive focus, then 300-500ms later it gets blur event
> > and the keyboard goes away. (It's a shame one has to do this kind
> > of silly stuff, when a plain simple keyboard element controllable
> > by the script, like a button or any other regular element, would put
> > an end to all the wasted time and bandwidth on this topic.)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to iphonewebdev@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to