good move! so, what do you see when this line is uncommented...? I've seen: "<tbody></tbody><tr><td>.....</td></tr>" as innerHtml... and after very exciting reading of How to Build Tables Dynamically (the last example) I added <tbody> to the structure of your table...
Originally posted by Eric Pascarello: make sure that the name and id are the same.
aha, it's a next problem...so, new rows have ID and NAME set to avoid empty result of getElementsByName() function...
it worked in IE6 and Mozilla 1.7.3, now, please verify this script in Firefox...
---------------------<br />SCJP(1.4)With 95%<br /> <br />Do it Right and Forget it!
posted 13 years ago
wow! It looks so nice but...it doesn't work in my IE of course there's hope it's something wrong with my M$ browser....but let's assume that not, so, I did small test: at the beginning of changeuploads() function I added: alert ( document.getElementById("uploads").tagName ) my IE showed 'FORM' (excuse me?) but Mozilla: 'SELECT' (uff...) The first: please, use unique names and id-s...I changed id/name of your form adding '_form' suffix. The second: construction of a table. When user selects required number of uploads the innerHTML of 'mulup' span will be: <TABLE><input type="file" name="file_1"<br>......</TABLE><input type="submit"> ooops...? So, in my opinion, it would be better to do small redesign of this code, it means: to write simple function returning full content of one row, then to invoke this function as many times as required. In this way you will generate let's say - interior - of your table. Finally, <table>,</table> tags and submit button have to be added. Of course, you can append tr/td/input tags directly in a loop....but when you separate this piece of code it will be a little bit easier to modify design of this table ( f.e. to set different colors for even/odd rows, etc..)
And the last one...it's a hint only: instead of typing <option value=.....></option> twenty times, you can use a loop...by the way, you can control max number of uploads, because value of maxUploads variable may be set dynamically during page generation
Here you have code:
Slime does not pay. Always keep your tiny ad dry.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop