Search code examples
javascriptjqueryipadkeyboardbootstrap-typeahead

On hiding iPad keyboard, HTML form field values are pre-populated even after reset


We have a HTML form with 2 fields. On signing in using signIn button or GO button of iPad keyboard, it displays a message in the same pop-up. On displaying message we have to clear or reset the values previously entered.

I'm resetting using: $('#kLoginForm')[0].reset();

It is clearing the fields and on hiding the iPad keyboard manually, the values are pre populated again, which should not happen.


Solution

  • If you are using typeahead then you have to clear the fields like this:

    $('#fieldName').typeahead('setQuery', '');
    

    So it will nullify that value.