Solved

automatically move cursor

Posted on 2007-04-04
4
176 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 250 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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 code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 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