Hi,
I have a input that looks like this :
<input type="file" id="ModelViewAd.Files[0]" name="ModelViewAd.Files[0]" />
The id and name is set in this way to be able to bind to the viewclass (ASP.NET MVC2).
When I try to run the following jquery command to get value :
$('#ModelViewAd.Files[0]').val()
I get undefined?
What am I doing wrong?
BestRegards
Solution : This is solved by changing the name (HTML4 do not suport [ and ]). But If you are using HTML5 then this can be solved by using escape chars like this : $('#ModelViewAd.Files\[0\]').val().