I am utilizing a modal for setting a default value for a series of text box fields. However, I only want to set the field to the default value if no value already exists. Is there a way to do that with a jQuery selector?
Current Code
var fooVal = $('#cboxLoadedContent').find('#SetFoo').val();
var barVal = $('#cboxLoadedContent').find('#SetBar').val();
$('.foo').val(fooVal);
$('.bar').val(barVal);