Page 1 of 1

My problem

Posted: Tue Apr 22, 2008 2:18 am
by anil27marc
i am using this code for creating a file type on click button but i have a problem that when a submit a form then no files found..

Code: Select all

<script language="JavaScript" >
function addfile()
{
    
    var txt=document.createElement('input');
    txt.type='file';
    txt.size='20';
    txt.name='item_img[]';
    document.getElementById('addtimage').insertBefore(txt,null);
    var txt=document.createElement('BR');
    document.getElementById('addtimage').insertBefore(txt,null);
}
 
</script>

Re: My problem

Posted: Tue Apr 22, 2008 11:11 am
by pickle
Your problem is compounded by the fact that:
  1. You didn't wrap your code in tags
  2. You posted in the wrong forum as per:
    [url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.
    We do have a client-side forum.
  3. you have a pretty useless subject:
    [url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
Nonetheless, welcome to the boards. I'm moving your thread & formatting it properly.

Re: My problem

Posted: Tue Apr 22, 2008 11:22 am
by onion2k
I'm going to take a wild guess and suggest that your form isn't encoding the data properly because you've not set it as enctype="multipart/form-data".

Re: My problem

Posted: Wed Apr 23, 2008 7:47 pm
by JellyFish
I'm not understanding your post. Could you please explain a little more? :?