Jump to content

hugebob

Members
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

0 Neutral

About hugebob

  • Rank
    Newbie
  1. When you submit the form, can you check and see that those dynamically created inputs are actually received? This is just maddening.
  2. DF, I gave this a try: adding the new elements to the tbody. But, still no go. I started off my base table like this: <table ...><tbody></tbody></table> I then altered my Javascript code to this: FileControlSet.prototype.addRow = function ( ) { var table = document.getElementById(this.id); var tbody = table.getElementsByTagName("tbody"); var insertionIndex = 0; if (tbody[0].rows.length < this.maxNumberOfFileControls) { insertionIndex = tbody[0].rows.length; var newTableRow = tbody[0].insertRow(insertionIndex); var newTableCell = document.createElemen
  3. Yes. Here's the form tag: <form action="blah.do" name="myform" id="myform" method="post" onSubmit="return ValidateForm(this)" enctype="multipart/form-data">
  4. Nope, no errors. Viewing console in Firebug, I can see the new controls being added to the DOM and I can see them and interact with them on the page. However, stepping through the onSubmit handler, references to those controls are undefined.
  5. Dsonesuk, I tried starting off with: <table id="uploadControlTable" width="100%" border="0" cellpadding="0" cellspacing="0"><tbody></tbody></table> But that didn't work.
  6. Hey JamesB, Here's my JS code that adds the form fields: function FileControlSet(tableID, maxControls){ this.id = tableID; this.maxNumberOfFileControls = maxControls; this.insertionIndex = 0;} FileControlSet.prototype.addRow = function ( ) { var table = document.getElementById(this.id); var rows = table.getElementsByTagName("tr"); var insertionIndex = 0; if (rows.length < this.maxNumberOfFileControls) { insertionIndex = rows.length; var newTableRow = table.insertRow(insertionIndex); var newTableCell = document.createElement("td"); newTableRow.appen
  7. Hi All, I've written some Javascript that will dynamically add "file" inputs to a form. They show up on the page just fine when the add control is clicked. But, when I submit the form, those dynamically added form fields are absent from the form structure on the receiving page. They're also absent from the form structure passed to the validation function. The added fields are added to a table within the form tags. The JS code adds table rows (TR). Then, cells are added to that row. Then, the file inputs to the cells. All this is done using DOM methods like appendChild(), createElement(),
×
×
  • Create New...