Ninjakreborn Posted December 15, 2009 Share Posted December 15, 2009 Ok...strange issue. I have a multi-adding system. It allows a user to input data then add similiar items. It is suppose to create the new form on a slider and moves the values from the old form to the new form. Nothing is submitted yet, it's all just in xhtml/css/javascript. They can add as many as they want then submit them all at once. The only field I can't seem to pass is the file. I want to be able to pass the photo from one form to the next. var inputs = document.forms["itemAddMultipleForm"].elements; for(var n = 0; n < inputs.length; n++) { if(inputs[n].id.replace('item['+assetType+']['+fromItem+']', '') == inputs[n].id) continue; var fromElem = $(inputs[n].id); var toElem = inputs[n].id.replaceAll('item['+assetType+']['+fromItem+']', 'item['+assetType+']['+toItem+']'); toElem = $(toElem); //for (x in fromElem) { // alert(x); //} switch(fromElem.type) { case "hidden": case "textarea": case "text": toElem.value = fromElem.value; break; case "select-one": toElem.selectedIndex = fromElem.selectedIndex; break; case "checkbox": toElem.checked = fromElem.checked; break; case "file": toElem.value = fromElem.value; break; } You can see were I added case "file" to try and do it..I tried moving value from the other to the new..and it's not working. Any advice. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.