JavaScript and client side scripting.
Moderator: General Moderators
-
anil27marc
- Forum Newbie
- Posts: 1
- Joined: Tue Apr 22, 2008 2:12 am
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>
-
pickle
- Briney Mod
- Posts: 6445
- Joined: Mon Jan 19, 2004 6:11 pm
- Location: 53.01N x 112.48W
-
Contact:
Post
by pickle »
Your problem is compounded by the fact that:
- You didn't wrap your code in tags
- You posted in the wrong forum as per:
We do have a client-side forum.
- you have a pretty useless subject:
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.
-
onion2k
- Jedi Mod
- Posts: 5263
- Joined: Tue Dec 21, 2004 5:03 pm
- Location: usrlab.com
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".
-
JellyFish
- DevNet Resident
- Posts: 1361
- Joined: Tue Feb 14, 2006 7:18 pm
- Location: San Diego, CA
Post
by JellyFish »
I'm not understanding your post. Could you please explain a little more?
