| | |
Change focus in a input grid form
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Feb 2006
Posts: 1
Reputation:
Solved Threads: 0
I wonder how I can change the focus to the next element(input field in a form) using java script. I believe that it is posible to write a function that can be event triggered in (onkeyup event, maybe ...) when the limit (maxlength="1" in my case) is reached. I'm a "null programer" in java script, so I try to find some help.
I intend to use a java script trick in a input grid (crossword solver), in order to avoid entering the solution letter by letter in the grid.
I'm wonder if it is posible to use somehow the arrows keys to move across the grid.
########################################
the field names are generated automatically by php and looks like:
name="lit_1_2" where 1 is the row and 2 is the col.
A cell looks like:
<td align = "center" style="border: 1px solid #CCCCFF" bgcolor = #ffffff ><input type="text" name="lit_3_1" size="1" maxlength="1" style="border: none; text-align: center; font: normal small-caps bold ;width: 1em" align="middle" ></td>
I intend to use a java script trick in a input grid (crossword solver), in order to avoid entering the solution letter by letter in the grid.
I'm wonder if it is posible to use somehow the arrows keys to move across the grid.
########################################
the field names are generated automatically by php and looks like:
name="lit_1_2" where 1 is the row and 2 is the col.
A cell looks like:
<td align = "center" style="border: 1px solid #CCCCFF" bgcolor = #ffffff ><input type="text" name="lit_3_1" size="1" maxlength="1" style="border: none; text-align: center; font: normal small-caps bold ;width: 1em" align="middle" ></td>
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
Hello. Please use the forum's code and formatting tags, and avoid things like "######" in your posts.
What have you already tried? Are you familiar with JavaScript's events and event handlers? You might investigate using the "onkeypress" or related event handlers. The particular keycode being generated will be a property of the Event object.
You can set focus to any particular element by using the "focus()" method.
So: research "JavaScript", onkeypress", "focus" and "Event". Web Searches might be "JavaScript Event object" and "JavaScript onkeypress", etc. Apply what you discover, try it, and come back with any specific questions.
What have you already tried? Are you familiar with JavaScript's events and event handlers? You might investigate using the "onkeypress" or related event handlers. The particular keycode being generated will be a property of the Event object.
You can set focus to any particular element by using the "focus()" method.
So: research "JavaScript", onkeypress", "focus" and "Event". Web Searches might be "JavaScript Event object" and "JavaScript onkeypress", etc. Apply what you discover, try it, and come back with any specific questions.
![]() |
Similar Threads
- Input data form - autofill from Excel or ACT! sql (ASP)
- Change Focus in textbox (C#)
- form submit redirect help, please (HTML and CSS)
- Stuck a bit on input (C)
- Preselection of stored value in an input control of a form (JavaScript / DHTML / AJAX)
- How do I create own Shout box/or input and display form? (PHP)
- change statement (JSP)
Other Threads in the HTML and CSS Forum
- Previous Thread: The Bane of AutoGenerated Code!
- Next Thread: Dreamweaver 8 ???
| Thread Tools | Search this Thread |
Tag cloud for HTML and CSS
2002 appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity create css deleted design development displayimageinsteadofflash dreamweaver drupal emailmarketing epilepsy explorer firefox flash font fonts form format frontpage google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft missing mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization perl pnginie6 positioning problem scroll seo shopping studio swf swf. templates textcolor theme timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7 wordpress xml xsl






