I have a form for uploading images. I\'d like to disable the submit button, until user selects an image to upload. I\'d like to do it with jQuery. Currently I have a JavaScr
If you're a fan of ternary expressions:
$(document).ready(function(){ var $submit = $('#submit_document'); var $file = $('#file_path'); $file.change( function(){ $submit.attr('disabled',($(this).val() ? false : true)); } ); });