The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make Reset button reset RSV error field highlighting and error messages DIV?
I have a form with RSV scripting and whatnot, and I noticed that when I press the Reset button to reset the form, it doesn't have any impact on the visibility of the error messages nor on the color-coding of the fields that are in error.

Presumably, I need to make a script that somehow resets the error messages and the color-coding on the error fields, but I'm having trouble figuring out what actually does that.

Any help would be greatly appreciated.

Doug Thompson
Manager of Web and Electronic Communications
Ohio Wesleyan University
Hi Doug,

Ah, for this you'd need to add a custom function. Do you have any JS libraries in the page (Prototype, jQuery, Mootools?) It's perfectly possible with "plain vanilla" javascript, but a library would make the code a lot simpler and shorter!

Let me know and I'll write up a function.

- Ben
I don't currently have any JS libraries on the page, but I use jQuery elsewhere on our site, so it wouldn't really be an issue for me to add that to the page if it would help.

Hi Doug,

Marvellous - that'll save some time!

Here's the code. You'll need to replace "reset_button_id" with the ID of your reset button, and "theErrorClass" with whatever error class you're using.

$(function() {
  $("#reset_button_id").bind("click", function() {

Let me know if you have any trouble with it!

- Ben
Worked great, but only to remove the error coloring on the fields that have errors.

So, since I'm using rsv.displayType="display-html", I added the following jQuery code to the function:


and that seems to have done the trick on removing the box of error messages as well.
Ah yes! Sorry, I should have thought of that.

Glad it's working now!

- Ben

Forum Jump:

Users browsing this thread: 1 Guest(s)