Click to See Complete Forum and Search --> : this element number...


mawood
02-14-2003, 01:23 PM
How do I get the current element number? Example: if I wanted to type in the second field on the form and capture its sequence -

<form>
<input name=one....
<input name=two onClick="alert(this.element);"...

Should show me the nuber '1' (second after '0').

What is the proper syntax for this?

mawood
02-14-2003, 02:28 PM
OK, well.....I have a JSP form that has some dynamic content. It asks how diagnostic code you have and then adds that number of fields to the form - these include a to and from date. These new fields all have the same name and I have java doing the work in back.

Now it has been requested to make these show todays date - done. They also want something odd: if the user changes a from date, the change should also happen in the to date (done in drop downs).

My thoughts were to attempt to capture the element number of the fromd date field, since they are repaeating field names, then add a number to it as to write to the to date field.

Hope that is clear enough. Thank you!!!

mawood
02-14-2003, 03:09 PM
Yes, I see that. I hoping I wouldn;t have to touch the dynamic section. Thank you so very much for your time - you've been a big help.