Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Struts component for javascript

Status
Not open for further replies.

pbuidev

Programmer
Jan 9, 2004
2
US
Hi,

I have a javascript function that will move the cursor focus from one text field to the next when the max length of the text field is reached. This javascript works fine on basic html. My problem is that my component is within iteration and nesting. This script can not find my component. I have tried many different options. I have given a snippet of the code in my jsp.

Thanks in advance for the assistance!


<nested:iterate id="param" property="parameterData">
<tr>
<th valign="top" nowrap="nowrap" >
<b><nested:write property="displayName"/></b>
</th>
<nested:equal value="D" property="dataType">
<td>
<nested:nest property="parameterDateValue">
<nested:text property="month" styleId="month"
maxlength="2" size="2"
onkeyup="TabField(this,'up',2,parameterDateValue.day)"
onkeydown="TabField(this,'down',2)" /> /
<nested:text property="day" styleId="day"
maxlength="2" size="2"
onkeyup="TabField(this,'up',2,parameterDateValue.year)"
onkeydown="TabField(this,'down',2)" /> /
<nested:text property="year" styleId="year"
maxlength="4" size="4" />
</nested:nest>
</td>
</nested:equal>
</tr>
</nested:iterate>
 
The field names don't match between event funtion field property
Code:
      <nested:nest property="parameterDateValue">
           <nested:text property="[COLOR=red]month[/color red]" styleId="month"
                        maxlength="2" size="2" 
                        onkeyup="TabField(this,'up',2,parameterDateValue.[COLOR=red]day[/color red])" 
                        onkeydown="TabField(this,'down',2)" /> / 
           <nested:text property="[COLOR=blue]day[/color blue]" styleId="day"
                        maxlength="2" size="2"
                        onkeyup="TabField(this,'up',2,parameterDateValue.[COLOR=blue]year[/color blue])" 
                        onkeydown="TabField(this,'down',2)" /> / 
           <nested:text property="year" styleId="year" 
                  maxlength="4" size="4" />
    </nested:nest>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top