Skip to content

Instantly share code, notes, and snippets.

@anil826
Created September 6, 2019 13:20
Show Gist options
  • Save anil826/fd779711d1c42165ae21ac6f60ea1225 to your computer and use it in GitHub Desktop.
Save anil826/fd779711d1c42165ae21ac6f60ea1225 to your computer and use it in GitHub Desktop.
Graham Check signature
//Hidden field
formyoula.form_fields['4556-bd6d-675d'].on("change",function(){
//Get img url - from hidden field
var img_url = formyoula.form_fields['4556-bd6d-675d'].get('value');
//check if there is URL
if(img_url.match("http")) {
//Hide the signature element
$("#component-30c1-3ddb-39d4").hide();
//Set Img URL to Formyoula HTML element - This is an HTML element
$("#component-8d9a-5809-dd75").html(img_url);
} else {
//If not URL then remove img tag from HTML element.
$("#component-8d9a-5809-dd75 img").remove();
//And show the signature element
$("#component-30c1-3ddb-39d4").show();
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment