Jump to content
reveret

getting the value of an input that is partially filled with predictive text

Recommended Posts

I have searched in vain for an answer to this problem, but I am getting no where.  Here is the issue:  I have a search form that works fine as a desktop application.  On mobile devices there is a problem.  If a user starts typing in the search input, and then taps one of the words that pops up in predictive text (such as on an iphone), this word then fills the input.  The search form returns no matches because, as I have discovered, the only thing being submitted is what the user actually typed before tapping the predictive hint.  For example, if they start typing Pennsylvania but only type "Pennsy" and then tap the suggestion, the only value in the input is "Pennsy," not the whole word.

I have seen some suggestions:  for example, setting the input type to 'password' prevents predictive suggestions (and thus requiring the user to type out the entire term), but this also triggers hiding the text submitted (as if it were a password). I have also seen some suggest that you could use setTimeout() before ajax submits the form to the server, but this did not work either and I am not quite sure of the logic behind this solution anyway.

Is there a way for javascript / jquery to "read" the value of an input that the user filled by means of tapping predictive text?

Thanks in advance'

reveret  

Share this post


Link to post
Share on other sites

Did you build the predictive functionality yourself, or are you saying that mobile devices will look like they set the value of the field but not actually set it?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...