My problem

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
anil27marc
Forum Newbie
Posts: 1
Joined: Tue Apr 22, 2008 2:12 am

My problem

Post 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>
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: My problem

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: My problem

Post 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".
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Re: My problem

Post by JellyFish »

I'm not understanding your post. Could you please explain a little more? :?
Post Reply