I have a form with javascript that auto generates a PO number based on date, time and initiator's initials which works, however, when the initiator saves the form and then goes back in to edit the form another PO number is generated on top of the original one. Is there a way to prevent the PO field from generating a PO number every time it is saved and reopened?
Question
Question
Answer
SELECTED ANSWER
replied on August 22, 2017
Jennifer is correct. The problem you're encountering is that your process is triggered anytime the form loads, not just the first time.
To address this, try the following
$(document).ready(function(){ if($('.qte div input').val() == ''){ //YOUR CODE HERE } });
1
0
Replies
replied on August 22, 2017
I am not familiar enough with scripting to write out an example but would it stay the same if you add in a if/else statement where if field is not null then create the value else don't create value?
1
0
SELECTED ANSWER
replied on August 22, 2017
Jennifer is correct. The problem you're encountering is that your process is triggered anytime the form loads, not just the first time.
To address this, try the following
$(document).ready(function(){ if($('.qte div input').val() == ''){ //YOUR CODE HERE } });
1
0
You are not allowed to follow up in this post.