I've spent too much time trying to get this to work. When I reject something, if the poNo field is empty, I'd like to put the value of the reqNo field into the poNo field, but I haven't gotten it to work yet! Here's my code:
$(document).ready(function(){ //Set PR # if PO # is blank and make comments required when voiding, removing required fields $('.Reject').click(function() { $('.lfProcessTask input').val('Final PO Package'); var reqNoInput = $('.reqNo input').val(); //Get value of Req. No. var poNoInput = $('.poNo input').val(); //Get value of PO No. if(poNoInput.val() == '') //If there's no PO # { poNoInput.val(reqNoInput); //Use the PR # as the PO # } else if($('#comments').val() == '') { alert('Please enter VOID details into the Comments box before selecting this action'); return false; } $('*[required]').each(function() { $(this).removeClass('required') $(this).removeAttr('required'); }); }); }); //close document ready
Fresh eyes would be great!