how to get values from $_Post with onchange="form.submit();"?


Posted on 16th Feb 2014 07:03 pm by admin

Hi, I have a form that submit to itself with a file upload field and two other hidden field values.
If I put a submit button on the page, all is working fine.

I don't like the submit button as its wasting space. So I want to use
Did you know?Explore Trending and Topic pages for more stories like this.
Code: <input size="10" type="file" name="img1" onchange="image.submit();">
If I add Code: print_r($_FILES); I do get the array but the
Code: if(isset($_POST['submit'])){}does nothing...

My form is as follow.....
Code: <form method="POST" name="image" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data" >
<table>
<input id="ad" name="ad" value="<?php echo $adnr;?>" type="hidden"/>
<input id="user" name="user" value="<?php echo $user;?>" type="hidden" />
<tr><td><input size="10" type="file" name="img1" onchange="image.submit();"></td></tr>
<tr><td><input type="submit" name="upload" value="Upload"></td></tr>
</table>

</form>
No comments posted yet

Your Answer:

Login to answer
130 Like 7 Dislike
Previous forums Next forums
Other forums

MySQL noob question
hi guys

I have a simple mysql table set up, along the lines of

Col 1 - Col 2 - Date_l

At max how many columns is advisable to create in a table/view
Hi All,
I have two transaction table from which i want to create a simple view or material

ScriptResource.axd gives an error on fresh install of ASP.NET Ajax 1.0
Hello,I have a fresh install of Microsoft ASP.NET Ajax 1.0. When I create an Ajax enabled website in

Agency Business Process
Hi,

I don’t understand the process of the agency business in SAP.

In my

How would I protect......
I have a from, actually, a good amount of forms. How can I make it so you can't type the characters:

'grab_files', multiple extension?
hey guys,

can anyone suggest a way to make to following line of code look for files with more

Can't shake the "Warning: include()" error
I've just uploaded my site to a new server and where I have PHP include tags in my HTML, the browser

Move array index to end
Hey guys,
Quick question:

I have an array that looks like this:
Code: [Select]$var =

problem with php server update from mid 2009
Hi,

I have this navigation menu on 2 websites which used to work just fine. After a recent up

Changing files over
Just thought I'd start with the new forums looking really nice .

Ok basically I've made this

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash