Topic: Input Field Text Selection (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=30584" title="Pages that link to Topic: Input Field Text Selection (Page 1 of 1)" rel="nofollow" >Topic: Input Field Text Selection <span class="small">(Page 1 of 1)</span>\

 
Karl
Bipolar (III) Inmate

From: Phoenix
Insane since: Jul 2001

posted posted 10-04-2008 06:44

I'm looking for some direction on how to select patterns of text in an input field as the user enters data into it. So a good example would be a pattern that looks like:

MM/DD/YYYY

When the user enters into the field, MM is selected, then by observing the correct keystrokes, DD is selected, and so on.

Thanks, I would appreciate the help in this!
Karl..

[edit]
I found this:
http://www.faqts.com/knowledge_base/view.phtml/aid/13562/fid/130

(Edited by Karl on 10-04-2008 07:07)

lucy1988
Nervous Wreck (II) Inmate

From:
Insane since: Sep 2008

posted posted 10-23-2008 10:22

Spammer. Please cease existing.

(Edited by Tyberius Prime on 10-23-2008 10:27)

hyperbole
Paranoid (IV) Inmate

From: Madison, Indiana
Insane since: Aug 2000

posted posted 10-27-2008 21:49

Karl,
This is not an easy problem to solve. For example, if the user enters 1 in the MM field are they entering a 1 for January or is it the first digit of 10, 11, or 12? You can write JavaScript code to filter the input and make fairly intelligent guesses about what the user wants, but you will always be better off letting the user do more and the computer do less in ambiguous situations.

Start by anaylizing all the possible input patterns for each field and write some simple checks for the boundary conditions. Then you can start adding more intelligence to the filter.

.



-- not necessarily stoned... just beautiful.


(Edited by hyperbole on 10-27-2008 21:50)

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 10-28-2008 16:03

how about having three input boxes?

CPrompt
Maniac (V) Inmate

From: there...no..there.....
Insane since: May 2001

posted posted 10-30-2008 14:06

if it's just dates, why not just have the typical 3 boxes like TP said? Then have them pre-populated with the months and days and year.

Later,

C:\



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu