iOS keyboard "go" button

7 posts, 0 answers
  1. Kevin
    Kevin avatar
    47 posts
    Member since:
    Nov 2012

    Posted 22 Apr 2013 Link to this post

    How can I utilize this button?

    I have a form that has a .submit method and i have a button on my page that has a click event that calls the form.submit(). this all works great but for some reason I can not get the "go" button to do anything at all.

    I looked at the airlines example app that seems to have this behavior but can not find anything different in it... kind of lost here as to why mine is not working. anybody have any ideas?
  2. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 23 Apr 2013 Link to this post

    Hi Kevin,

    The behavior you describe is handled by the UIWebView itself and we do not have any control over this i.e. we haven't done anything special for the sample app you talk about. Check your html markup and verify it is valid, as this is a possible culprit.

    Kind regards,
    Steve
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Kendo UI Dojo.
  3. Kevin
    Kevin avatar
    47 posts
    Member since:
    Nov 2012

    Posted 23 Apr 2013 Link to this post

    Unfortunately in this case it doesn't seem to be the cause. I ran my markup through w3c markup validator and the only error that comes back is from the "switch" input element not having a type. (This is how the kendo UI demo shows it used properly, and for kicks i removed the switch input completely, no change in functionality regarding the go button)

    http://demos.kendoui.com/mobile/switch/index.html#/

    Nothing else is coming up =(

    *update: as a followup. i added an alert inside the submit event (and yes i have return false in there as i found similar problems that were solved in this way.. but it didnt fix it for me).... it never triggers the alert with the go button. just nothing happens at all. but the normal submit button on the page works just fine.
  4. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 23 Apr 2013 Link to this post

    Hi Kevin,

    A quick search shows that you need <input type="submit"> in order for the Go button to work as submit. Please double check whether you have specified type or you're not using hyperlink instead.

    Greetings,
    Steve
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Kendo UI Dojo.
  5. Kevin
    Kevin avatar
    47 posts
    Member since:
    Nov 2012

    Posted 23 Apr 2013 Link to this post

    I am using an input type = "submit" i already double checked that one as well. =\

    Interestingly enough, i also went down the path of removing the form tag entirely and the go button switches to a "return" button. I'm fine with this, i'd just have to manually construct my form.serialize.... unfortunately the "return" button fails to work as well. tapping it does absolutely nothing.... i'd expect it would close the keyboard, but it does not
  6. Kevin
    Kevin avatar
    47 posts
    Member since:
    Nov 2012

    Posted 23 Apr 2013 Link to this post

    I figured it out!

    I had originally used an <a> button for the submit. with some custom styling and what not.

    <a data-role="button" data-click="debtApp.clickEvents.saveProfile" id="save-profile" name="save-profile" class="km-button" style="text-align: center; margin: 0px 1% 5px 1%; padding: 15px 0px 15px 0px; width: 98%; font-size: 1.6em; font-weight: bold;">Save Changes</a>

    changed it to input type="submit" and no change...

    what ended up working was switching it back to the a tag and instead putting a bare bones submit button hidden on the page before it.

    <input type="submit" style="visiblity: hidden; position: absolute;/>

    now everything is working peachy!

    **update: however the keyboard fails to close... hmmm 

    fixed it by adding a $("input").blur(); at the end of the submit function. yay
  7. David
    David avatar
    60 posts
    Member since:
    Nov 2012

    Posted 01 May 2013 Link to this post

    I struggled with getting the submit functionality to work as well but in the end I found that I was over complicating the issue.  In my case I didn't need a 'submit' I needed the input to respond to the 'go' key (keyCode 13) and perform the same action as though one of my buttons had been clicked (that is instead of 'clicking' the button, just call the method that click is bound to on the view model).

    In my case on the login page I wanted the go key to trigger the login method on my view model.  You can do that like so:

      $("#login input").keyup(function(e) { //inputs on login view should call vm.login method on 'enter'
         if(e.keyCode === 13) {
          vm.login(); 
            $(this).blur(); //iOS likes to keep the keyboard open ... so remove focus to close it
          }
       });

    This could probably be made to be more generic and dynamically wire this up based on some data-attribute on a view but the code is so simple and I only needed it on 2 views so I just left it like that.
Back to Top