How can I prevent the Go button on iPad/iPhone from posting the form

后端 未结 6 1470
北海茫月
北海茫月 2020-12-31 00:52

I have a dynamic form that is to be displayed using an iPad.

This form has a couple of radio buttons and some text fields and one submit button.

In an iPad t

6条回答
  •  时光说笑
    2020-12-31 01:00

    Seems very unconventional, as this basically breaks general UX and expected device behaviour.

    However, I think it also important to mention that this solution relies on the actual

    DOM element. Meaning the onclick handler on the button should not use a jQuery object to submit but the DOM element.

    jQuery object. Does not work:

    
    

    DOM element. Works:

    
    

    Without jQuery. Works:

    
    

    Also, here is a similar approach, using jQuery to intercept keyboard submits and only allowing clicks on a button. Credit goes to @levi: http://jsfiddle.net/RsKc7/

提交回复
热议问题