thread-pond / signature-pad

A jQuery plugin for assisting in the creation of an HTML5 canvas based signature pad. Records the drawn signature in JSON for later regeneration.
BSD 3-Clause "New" or "Revised" License
727 stars 292 forks source link

How to change location of error messages #183

Open radman63 opened 8 years ago

radman63 commented 8 years ago

By default, error messages that get generated when someone doesn't sign a form are displayed at the very beginning of the form, using the markup

. Unfortunately, my signature pads are at the bottom of the form, so users that forget to sign the form never see the error message and just keep clicking the "submit" button.

How do I re-position the error messages so they display close to where the signature pad is displayed? Thanks.

Regards, Bill

thomasjbradley commented 8 years ago

You could try using the onFormError callback function to create your own error message on the form where you'd like to see it.

radman63 commented 8 years ago

You wouldn't happen to have an example of this, would you? Unfortunately, I'm a non-programmer that sometimes has to deal with programming. Thanks.

--------- Original Message --------- Subject: Re: [thomasjbradley/signature-pad] How to change location of error messages (#183) From: "Thomas J Bradley" notifications@github.com Date: 6/15/16 4:43 am To: "thomasjbradley/signature-pad" signature-pad@noreply.github.com Cc: "radman63" bill@renegadeelectronics.com, "Author" author@noreply.github.com

You could try using the onFormError callback function to create your own error message on the form where you'd like to see it.

You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

thomasjbradley commented 8 years ago

To start you can do something like this:

$('.sigPad').signaturePad({
  onFormError: function (errors, context, settings) {
    // In here you can write the code needed to insert the error message
  }
});