We capture names and dates for electronic signatures. We also allow folks to reassign tasks. Because of that, for each form, I have fields that will capture current user and current username:
The javascript then takes the info and copies it to the corresponding field:
$(document).ready(function(){ //Change to Current User var assignedUsername = $('.peUsername input').val(''); //Clear value in username field var assignedUser = $('.pe input').val(''); //Clear variable var currentUser = $('.currentPEUser input').val(); //Get variable var currentUsername = $('.currentPEUsername input').val(); //Get variable $(assignedUser).prop("readonly", false); $(assignedUser).val(currentUser).change(); $(assignedUser).prop("readonly", true); $(assignedUsername).val(currentUsername).change(); }); //close document.ready
While the user has the form open, it does change the name ... however, it reverts back to what it was before when it goes to the next form. Any ideas why?