McDave
03-12-2004, 02:29 PM
Hi,
I'm building an interactive form that will convert CMY color values to RGB. The form starts with no input capabilities but each time you select "add form objects" from the web page, it will adds a row of input boxes to a table. There is no limit to the number of rows you can add. The idea is that you add the CMY values to the first set of boxes in the row, click convert and the RGB values appear in the second set of boxes in the row and a box of the selected color appears to the right of the RGB values.
The new form elements are added to the <TBody> tag using createElement() and appendChild(). Since input text elements of a certain color will all be named the same, say "Cyan", my understanding of javascript is that it will create an array of "Cyan" form object that can be referred to as Cyan[0], Cyan[1] ..etc. Adding the rows works fine and is not the problem.
When trying to convert the values, I want to find out how many rows have been added. Given that, and if the name of the form object is "convert", I should be able to get the length of that array and therefore the number of "Cyan" input boxes by the following reference:
document.convert.Cyan.length ;
When running this on IE 6, I get the following error message: "document.convert.Cyan.length is null or not an object".
When running it on Opera 7, it works like a charm!
Anyone have any ideas??
Thanks in advance.
I'm building an interactive form that will convert CMY color values to RGB. The form starts with no input capabilities but each time you select "add form objects" from the web page, it will adds a row of input boxes to a table. There is no limit to the number of rows you can add. The idea is that you add the CMY values to the first set of boxes in the row, click convert and the RGB values appear in the second set of boxes in the row and a box of the selected color appears to the right of the RGB values.
The new form elements are added to the <TBody> tag using createElement() and appendChild(). Since input text elements of a certain color will all be named the same, say "Cyan", my understanding of javascript is that it will create an array of "Cyan" form object that can be referred to as Cyan[0], Cyan[1] ..etc. Adding the rows works fine and is not the problem.
When trying to convert the values, I want to find out how many rows have been added. Given that, and if the name of the form object is "convert", I should be able to get the length of that array and therefore the number of "Cyan" input boxes by the following reference:
document.convert.Cyan.length ;
When running this on IE 6, I get the following error message: "document.convert.Cyan.length is null or not an object".
When running it on Opera 7, it works like a charm!
Anyone have any ideas??
Thanks in advance.