The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.31 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.31 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.31 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
How to make Reset button reset RSV error field highlighting and error messages DIV? - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Modules / Other (https://forums.formtools.org/forumdisplay.php?fid=8)
+--- Forum: Form Validation: JS + PHP (https://forums.formtools.org/forumdisplay.php?fid=18)
+--- Thread: How to make Reset button reset RSV error field highlighting and error messages DIV? (/showthread.php?tid=1499)



How to make Reset button reset RSV error field highlighting and error messages DIV? - dethompsOWU - Aug 3rd, 2011

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.

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


RE: How to make Reset button reset RSV error field highlighting and error messages DIV? - Ben - Aug 4th, 2011

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



RE: How to make Reset button reset RSV error field highlighting and error messages DIV? - dethompsOWU - Aug 5th, 2011

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.

Thanks,


RE: How to make Reset button reset RSV error field highlighting and error messages DIV? - Ben - Aug 5th, 2011

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.

Code:
$(function() {
  $("#reset_button_id").bind("click", function() {
    $(".theErrorClass").removeClass("theErrorClass");
  });
});

Let me know if you have any trouble with it!

- Ben


RE: How to make Reset button reset RSV error field highlighting and error messages DIV? - dethompsOWU - Aug 8th, 2011

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:

$("#rsvErrors").hide();

and that seems to have done the trick on removing the box of error messages as well.


RE: How to make Reset button reset RSV error field highlighting and error messages DIV? - Ben - Aug 8th, 2011

Ah yes! Sorry, I should have thought of that.

Glad it's working now!

- Ben