0

I'm refurbishing a simple web-app that our field techs use. One of my goals is to make it Blackberry-friendly, as all of the techs are now using those. This app accepts basic information about a job and stores it. Among that info are times, telephone numbers, and a street address.

I have the time fields and telephone fields figured out with the following CSS:

     input.time  { -wap-input-format: "NN\\:NN"; }
     input.phone { -wap-input-format: "\\(nnn\\)\\ nnn\\-nnnn" }

What I'm trying to do is determine how I can have the phone default to numeric input on an address field, then go alpha once a space has been inserted. I'm assuming that this can't be done with the -wap-input-format property above.

Is there another way--even if it's only for the Blackberry Browser--to do this without resorting to JavaScript? (Not that there's anything wrong with that :-) )

Thanks.

willpall
  • 117
  • 1
  • 7

2 Answers2

1

Have you considered a "Street Number" field followed by a separate "Street Name" field? There is no way to have a variable number of digits at the start of this sort WAP input field without using JavaScript.

Sparr
  • 7,489
  • 31
  • 48
  • This seems to be the best way. I wanted to avoid cluttering the interface too much, but usability trumps prettiness any day. Thanks. – willpall Jan 15 '09 at 04:47
  • Depending on how you style your text inputs, there's no reason for the two fields to have any more clutter than the vertical separator between them. – Sparr Jan 15 '09 at 19:53
0

I've found that javascript alone is the only way to do a decent job of subtle user input validation. Markup creates more challenges than it solves. With js you can let whatever keystrokes mean whatever you want, customized to any context.

dkretz
  • 37,399
  • 13
  • 80
  • 138