Refresh Section on clicking "Accept" or "Clear" in Signature Capture field
I have a section that contains a "signature capture" field and a date property called "RequesterSignatureDate". When a user signs the signature capture field and clicks "Accept", I would like to update the "RequesterSignatureDate" with the current date, and refresh the section. If the user clicks "Clear", I want to clear "RequesterSignatureDate", and refresh the section.
I have attempted to set a "Refresh Condition" on the section and run a data transformation when the Signature field changes, but I have been unsuccessful. There is no way to add an Action Set to a "signature capture" field, either.
Any suggestions are appreciated.
If the RequesterSignatureDate is just for the display purpose, I have an idea to accomplish this without relying on activity/data transform or a refresh section.
1.Add a hidden non auto generated section just below the signature control
2. Add the below code in that section
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
var dateTime = date+' '+time;
$("[name='$PpyWorkPage$pFirstName']").val(dateTime); /* this name should be changed based on where you want to display the date*/
$("[name='$PpyWorkPage$pFirstName']").val(""); /* this name should be changed based on where you want to display the date*/
This code is to add click events on accept and clear buttons to set and clear current date time. As commented in the code, you need to replace the name of text input with your's.
You can change the format of the date time based on your requirements.
I am attaching gif that shows the working behavior. I am not sure if there is a better way to achieve this.
Keep up to date on this post and subscribe to comments
- In all the reports we have "Clear Filter" button. Can we change its function to--"When we click on Clear Filter button all filters should be removed and no data should be displayed in the reports". This is our requirement. Can we do this?
- How to make a signature capture field as mandatory
- How to clear date field when "Allow text entry" is disabled
- Refreshing section clearing values on the screen
- Refresh this section is not working if the section contains Obfuscated text fields(Password kind of field)