views:

49

answers:

1

let say with this code

<form action='' method='POST' enctype='multipart/form-data'>
<input type='file' name='userFile'><br>
<input type='submit' name='upload_btn' value='upload'>
</form>

with this we get

alt text

now when we click the 'Browse...' button, a file search dialog box is opened

alt text

now the user will select the file by double-clicking the file or by clicking the button 'Open'.

What i WNAT TO DO is launch a javascript\php function after the file is selected that is press of the 'Open' button. HOW TO DO IT...

+3  A: 

Listen to the change event.

input.onchange = function(e) { 
  ..
};
Anurag
we gonna write it where.. in javascript script tags
Junaid Saeed
yes in script tags, or you could add it as an attribute (`<input type="file" onchange="..." />`) although this is not recommended.
Anurag