12-06-2009, 10:41 PM
|
#7 (permalink)
|
|
The Addict
Join Date: Jun 2008
Posts: 335
Thanks: 2
|
Quote:
Originally Posted by ETbyrne
Adding onto what Village Idiot said, it is also not possible to set the value of a file input with javascript. For example this jQuery will produce an error and not work:
javascript Code:
jQuery(function(){
jQuery('input[type=text]').keyup(function(){ // Get value of text box var text = jQuery(this).val(); // Set value of file box (produces error) jQuery('input[type=file]').val(text); });
});
|
The reason for the above should be fairly obvious, imagine let's say that the file input value WAS settable via JavaScript ( or any other method for that matter ) important confidential files could be set silently by just having several file inputs on the page upon load hidden via css. Press Submit, the next page takes a while to load but you just attribute it to a laggy connection. Meanwhile, the fiends are absconding with your precious files.
|
|
|
|