> Okay I have a form/table that I build from an array. What I
> need to do is create some one the fly math for inverse cells
> of this table. that is, if the value of row 1 column 2 is
> input to be 2, then the value of row 2 column 1 must be .50.
> So I need to write some javascript that takes the value put
> into the field and onblur or whatever writes its its inverse
> into its reciprocal cell. The problem is how do I know what
> the name of the field is when the field name is dynamically
> generated?
As long as there's some pattern or meaningful relationship between the
fields, you should be able to reference one field relative to its position
from another. For example, if you have a table with two columns, and you
have a text field in each column, and you want to take a value from the
first field, do something with it, and put the result into the second, there
are several ways you could do this. The way I'd probably do it is to pass
the first field as an argument to the JavaScript event handler for the
field, rather than passing the value of the field as your example code did:
<INPUT TYPE="text" NAME="field#CurrentRow##Element#"
ONBLUR="critweight(this);">
Then, in your function, you could figure out the target field based on
either its relative location in the elements array, or by parsing the name
of the target field based on your naming convention and then referencing it
directly.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.