You could replace the file input when the URL field is focused: $('#fu').replaceWith('<input id="fu" type="file" />');
where #fu is the file input. On Oct 12, 11:53 am, amuhlou <amysch...@gmail.com> wrote: > hmm yeah, I did a quick google search and it appears that allowing you > to access a file input's value attribute would pose a security issue. > > I found a solution but the code isn't exactly > prettyhttp://gusiev.com/2009/04/clear-upload-file-input-field/ > > On Oct 12, 6:43 pm, captaincarp <harry.wi...@gmail.com> wrote: > > > > > Yeah this is what I've been trying, > > > i think maybe different rules apply for file inputs perhaps? > > > amuhlou wrote: > > > > Try: > > > > $('#input_id').focus(function(){ > > > $(this).attr("value",""); > > > }); > > > > On Oct 12, 5:59 pm, captaincarp <harry.wi...@gmail.com> wrote: > > >> My image upload form has a choice of either upload image by entering url > > >> or > > >> by browsing for a file, > > > >> I'm trying to empty the file-input input if you focus on the url-input. > > > >> I've tried bother these events on click/blur but neither seem to work > > >> like > > >> they would for a checkbox or text input... > > > >> $('#input_id').empty(); > > >> $('#input_id').attr('value', ''); > > > >> any ideas would be help my head! > > >> -- > > >> View this message in > > >> context:http://www.nabble.com/possible-to-empty-file-input-in-form-with-.clic... > > >> Sent from the jQuery General Discussion mailing list archive at > > >> Nabble.com. > > > -- > > View this message in > > context:http://www.nabble.com/possible-to-empty-file-input-in-form-with-.clic... > > Sent from the jQuery General Discussion mailing list archive at Nabble.com.