# Form problem

**URL:** <https://forum.kirupa.com/t/form-problem/53627>\
**Category:** Uncategorized\
**Created:** [June 5, 2004, 9:17pm UTC](https://forum.kirupa.com/t/form-problem/53627 "2004-06-05T21:17:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gerartje](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@gerartje](https://forum.kirupa.com/u/gerartje)\
**Post date:** [June 5, 2004, 9:17pm UTC](https://forum.kirupa.com/t/form-problem/53627/1 "2004-06-05T21:17:33Z")

</div>

hello,

this is the situation…  
I can select an image from in flash. When I click on upload in flash, I call a javascript function test();. This also works because I’ve tested it with an alert().

In the function test() I’ve placed a click event on the submit button, so he would submit my image to a php file, but its always permission denied… arghhh

document.forms.form1.elements[0].click();  
//opens the browse dialog–\>works

function test()  
{  
alert(“uploaden”);  
document.forms.form1.elements[1].click();  
[//document.form1.submit](https://document.form1.submit)();  
}

I tried 2 ways

- document.forms.form1.elements[1].click();  
//posts the image to php --\> doesn’t work --\> permission denied!!!

- document.form1.submit();  
//output: object has no such methods or properties

// FORM  
//

```auto
   form name="form1" ACTION="portfolio/upload.php" 
   METHOD="POST" ENCTYPE="multipart/form-data"> 
   input type="file" name="file" onChange="doFlashCommand(this.value)"> 
   input type="submit" name="submit" value="testen"> 
   /form> 

```

//deleted those \< otherwise it showed up as a real form

I don’t work with frames, everything is on one page…  
I don’t know it anymore, getting frustrated…  
Tested the the click event in another example and there it works… :s  
(same code)

grtz
