Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

automatically move cursor

Posted on 2007-04-04
4
Medium Priority
?
182 Views
Last Modified: 2010-04-09
hi guys

I have a field called Judgment number which is a combination of three fields like this

<html:text  style="fieldheight"  property="J_TYPE_CODE" size="4" maxlength="2" />
<html:text  style="fieldheight"  property="J_SEQUENCE_NUMBER" size="15" maxlength="6" />
<html:text  style="fieldheight"  property="J_NUMBER_YEAR" size="4" maxlength="2"/>

When user enters something in the first text box J_TYPE_CODE, i want the cusror to be automatically moved to the next text box
J_SEQUENCE_NUMBER  and then after entering something in the second text box i want the cursor to automatically move
to J_NUMBER_YEAR

i have seen this feature in many websites , any idea how i can do that

thanks
J
0
Comment
Question by:jaggernat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 18852924
<html:text  style="fieldheight"  property="J_TYPE_CODE" size="4" maxlength="2" onkeyup="if(this.value.length==this.value.maxLength)this.form['J_SEQUENCE_NUMBER'].focus();" />


<html:text  style="fieldheight"  property="J_SEQUENCE_NUMBER" size="15" maxlength="6" onkeyup="if(this.value.length==this.value.maxLength)this.form['J_NUMBER_YEAR'].focus();" />

... assumes the generated HTML has name properties that match the properties above.
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 18852936
sorry, left out the elements array:

<html:text  style="fieldheight"  property="J_TYPE_CODE" size="4" maxlength="2"
onkeyup="if(this.value.length==this.value.maxLength)this.form.elements['J_SEQUENCE_NUMBER'].focus();" />


<html:text  style="fieldheight"  property="J_SEQUENCE_NUMBER" size="15" maxlength="6"
onkeyup="if(this.value.length==this.value.maxLength)this.form.elements['J_NUMBER_YEAR'].focus();" />

0
 
LVL 33

Accepted Solution

by:
knightEknight earned 1000 total points
ID: 18852963
DOH!  Still had a typo -- really sorry.  The maxLength property belongs to the field, not the value of the field:


<html:text  style="fieldheight"  property="J_TYPE_CODE" size="4" maxlength="2"
  onkeyup="if(this.value.length==this.maxLength)this.form.elements['J_SEQUENCE_NUMBER'].focus();" />


<html:text  style="fieldheight"  property="J_SEQUENCE_NUMBER" size="15" maxlength="6"
  onkeyup="if(this.value.length==this.maxLength)this.form.elements['J_NUMBER_YEAR'].focus();" />

0
 
LVL 10

Author Comment

by:jaggernat
ID: 18853273
thank you
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Find out what you should include to make the best professional email signature for your organization.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question