I want to get all the file upload controls on my page, Im adding multiple file upload control so i dont have any idea how many they can be but i have to get all of them in jquery. Im using asp.net mvc and jquery
+4
A:
Use:
$(':file').each(function(){
// your code to handle input type files.
});
Or:
$('input[type="file"]').each(function(){
// your code to handle input type files.
});
More Info:
Sarfraz
2010-07-31 08:37:22
A:
When do you want to get the input field? after clicking a button? or changing the input field? if you add dynamic the input field than you can maybe better use the live option.
$('input[type="file"]').live("blur",function(){
$('input[type="file"]').each(function(){
// you can put your code here
});
});
see: http://api.jquery.com/live/
above code is from jQuery 1.4
Better give more information next time
michel
2010-07-31 08:51:04