How to know if a signature has been updated

Created on 11 October 2014, about 10 years ago
Updated 28 February 2023, almost 2 years ago

How is it possible to check if the user has updated a signature in form validate?
If you edit a form with a signature field, you can sign and submit the form or you can just submit the form without changing the signature.
In the form validation, I have tried a check like the following to see if the signature has been updated:

function is_sign_updated($form,$form_state){
	$old=$form['my_sign_field'][LANGUAGE_NONE][0]['data']['#default_value'];
	$new=$form_state['values']['my_sign_field'][LANGUAGE_NONE][0]['data'];
	return !($old==$new);
}

But it seems that even if you don't change the field value, a new png file is created each time you submit the form... thus this function will return true in all cases...

Any idea?

💬 Support request
Status

Closed: outdated

Version

1.0

Component

Miscellaneous

Created by

🇧🇪Belgium DuneBL

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024