2

I have a site which is optimized for mobile devices. I also have a sign in page on this site. Once a user fills the credentials he/she can sign in using a sign in button. but I also want that the same operation happen when they tab the "Go" button or "Enter" button on the key pad.

how can we implement that?

the other thing also, on iPhone how you can change the key pad type that pop up when a text field is active? I know if you want to get a number key pad you set the type="tel" for the tribute of the input tag.

how about for the other types of key pads?

tanx

shebelaw
  • 3,992
  • 6
  • 35
  • 48

1 Answers1

2

For the first part - a standard <input type="submit"/> will be activated by default when the "Go"/"Enter" button will be pressed, as with the "Enter" key will work on a desktop browser.

For other special input types, there are those:

<input type="email">
<input type="url"><!-- web address -->
<input type="number" min="0" max="10" step="2" value="6"><!-- dial -->
<input type="range" min="0" max="10" step="2" value="6"><!-- slider -->
<input type="search"><!-- quess what? -->

They are documented well on Dive Into HTML5 page.

Important: remember that <input> elements have to be enclosed inside a <form> to work!

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
skolima
  • 31,963
  • 27
  • 115
  • 151
  • tanks @skolima I also look at the link you provide. I have input type= "text" for username and "password" for password text field I also have type "submit" for the button. but I am not getting the the "Go" button keypad on iPhone. – shebelaw Jun 07 '11 at 14:53
  • Do you perhaps have a `display:none` set on the submit button? If yes, then this a known bug in Safari, change it instead to `margin-left: -1000px`. – skolima Jun 07 '11 at 15:34
  • @skolima no I don't have 'display:none' to the submit button. – shebelaw Jun 07 '11 at 15:40
  • Hmm, can you please post the html for the form? Just update your question. – skolima Jun 07 '11 at 15:43
  • I am not using a form, would that be an issue – shebelaw Jun 07 '11 at 16:13
  • Yes it would, all `` elements have to be enclosed inside a `
    ` to work.
    – skolima Jun 07 '11 at 20:12