Zaub
05-04-2009, 04:36 AM
I need some help with a script I'm using.
I have a working script at the moment where I have a file field and you click the link and it adds more file options.
But if I have already selected a file in the field and click Add More it removes the currently selected file.
Here is the code:
<div id="addmoreimages">
<input name="ufile[]" type="file" id="ufile[]" size="50" /><br>
</div>
<script type="text/javascript">
function add_more_images(){
document.getElementById('addmoreimages').innerHTML = document.getElementById('addmoreimages').innerHTML + '<input name="ufile[]" type="file" id="ufile[]" size="50" /><br>';
}
</script>
<a href="javascript:add_more_images()">Add more images</a>
+REP for any help.
Thanks,
Chris.
I have a working script at the moment where I have a file field and you click the link and it adds more file options.
But if I have already selected a file in the field and click Add More it removes the currently selected file.
Here is the code:
<div id="addmoreimages">
<input name="ufile[]" type="file" id="ufile[]" size="50" /><br>
</div>
<script type="text/javascript">
function add_more_images(){
document.getElementById('addmoreimages').innerHTML = document.getElementById('addmoreimages').innerHTML + '<input name="ufile[]" type="file" id="ufile[]" size="50" /><br>';
}
</script>
<a href="javascript:add_more_images()">Add more images</a>
+REP for any help.
Thanks,
Chris.