July 20, 200818 yr Hello, I am coding a contact form with multiple file attachments, I've run into some problems with the presentation and was wondering if you guys had any solutions. The page in question is: http://www.tempusphoto.co.uk/contact-test.html I am calling a javascript function that creates a child div with a 'file input box' in it and adds it to the parent div (called "content"). I need to use divs, so I can allow users to remove the file input boxes. The problem is that the divs are placed underneath the submit box. Is there a way I can reposition the submit box and the text below it when boxes are added, so that they are added above the submit box + text
July 20, 200818 yr I see you have that function "addAttachBox" that does this: .... document.getElementById('content').appendChild(newdiv); .... Instead of appending to #content, why don't you place a #something div inside the form right after attachments ? Then you can have: .... document.getElementById('something').appendChild(newdiv); ....
July 20, 200818 yr Author Instead of appending to #content, why don't you place a #something div inside the form right after attachments? Hi there, I've tried that before posting here ... didn't have much success:- This is the XHTML code: <tr> <td class="label">Attachments:</td> <td class="element"> <input type="file" name="filename1"> <a href="java script:;" onClick="addAttachBox();... </tr> <div id="boxcontainer"></div> Javascript changed to: document.getElementById('boxcontainer').appendChild(newdiv); and the result: http://www.tempusphoto.co.uk/contact-test.html
July 21, 200818 yr It should be something like this: <tr> <td class="label">Attachments:</td> <td class="element"><input type="file" name="filename1"> <a href="java script:;" onClick="addAttachBox();">Add Attachments</a></td> </tr> <tr><td colspan="2"> <div id="boxcontainer"> </div> </td></tr> <tr> <td><input type="hidden" name="counter" value="1" /></td> <td><input id="normal" type="submit" name="Submit" value="Submit" /></td> </tr> The boxcontainer div should be on a row inside the table you already have.
Create an account or sign in to comment