The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/showthread.php 26 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/showthread.php 26 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/showthread.php 26 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1380 fetch_forum_permissions
/inc/functions.php 2909 forum_permissions
/showthread.php 621 build_forum_jump
Warning [2] Undefined array key "mybb" - Line: 1952 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1952 errorHandler->error
/inc/functions_indicators.php 41 my_set_array_cookie
/showthread.php 629 mark_thread_read
Warning [2] Undefined property: MyLanguage::$ratings_update_error - Line: 5 - File: showthread.php(732) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(732) : eval()'d code 5 errorHandler->error
/showthread.php 732 eval
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions_user.php 844 is_member
/inc/functions_post.php 406 purgespammer_show
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "profilefield" - Line: 6 - File: inc/functions_post.php(474) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php(474) : eval()'d code 6 errorHandler->error
/inc/functions_post.php 474 eval
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "canonlyreplyownthreads" - Line: 660 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 660 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showimages" - Line: 741 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 741 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "showvideos" - Line: 746 - File: inc/functions_post.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions_post.php 746 errorHandler->error
/showthread.php 1070 build_postbit
Warning [2] Undefined array key "invisible" - Line: 1506 - File: showthread.php PHP 8.1.27 (Linux)
File Line Function
/showthread.php 1506 errorHandler->error
Warning [2] Undefined variable $threadnotesbox - Line: 30 - File: showthread.php(1533) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 30 errorHandler->error
/showthread.php 1533 eval
Warning [2] Undefined variable $addremovesubscription - Line: 79 - File: showthread.php(1533) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/showthread.php(1533) : eval()'d code 79 errorHandler->error
/showthread.php 1533 eval



FORUMS


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
Problem with initializing array in RSV in jQuery?
#1
I'm using the RSV jQuery plugin, so if this is the incorrect place to post this question, please let me know where I should take this inquiry.

I have a very complicated form involving validation rules that change depending upon which radio button a user selects.

It's all working fine except in the use-case scenario where someone "changes their mind" and clicks a different radio button. The rules change as expected and everything seems to work fine, but there appears to be some "bleed-through" of the validation rules from the earlier radio button selection.

I only noticed this because one of the radio button selections has a larger overall set of rules than the other. When I choose the larger and then change to the smaller, it still validates against the larger's rules.

I'm doing all this with a jQuery bind("change") if/else statement:


PHP Code:
$("[name=submissionType]").bind("change", function() {
        if ($(this).val() == 'Submission_Event') {
            $("#EventInformation").show();
            $("#OWUDailyCalendarForm").RSV({
                displayType"alert-one",
                rules:["required,firstName,Please enter the OWU contact's first name.",
                "required,lastName,Please enter the OWU contact's last name.",
                "custom_alpha,phoneNumber,xxx-xxx-xxxx,Please enter your phone number in the format ###-###-####.",
                "required,emailAddress,Please enter the OWU contact's personal email address.",
                "reg_exp,emailAddress,.*@owu\.edu$,Please enter a valid personal OWU email address.",
                "required,emailAddressForPublication,Please enter an OWU email address for publication.",
                "reg_exp,emailAddressForPublication,.*@owu\.edu$,Please enter a valid OWU email address for publication.",
                "required,OWUSponsoringOrganizationOffice,Please enter the OWU sponsoring organization/office.",
                "required,category,Please select a category for your submission.",
                "required,submissionType,Please select whether your submission is an event or a non-event.",
                "required,eventNameTitle,Please enter the name / title of your event.",
                "required,eventLocation,Please select the location for your event.",
                "required,startDateTime,Please select the start date and time for your event.",
                "required,endDateTime,Please select the end date and time for your event.",
                "required,OWUDailyHeadline,Please enter a headline for your OWU Daily entry.",
                "required,OWUDailyDescription,Please enter a short description for your OWU Daily entry.",
                "required,firstPublicationDate,Please select the first publication date for your OWU Daily entry.",
                "required,roomReservationAcknowledgement\[\],You must acknowledge your room reservation in order to submit this form."
                ]
            });
        }
        else if ($(this).val() == 'Submission_Non-Event') {
            $("#EventInformation").hide();
            $("#OWUDailyCalendarForm").RSV({
                displayType"alert-one",                
                rules
: ["required,firstName,Please enter the OWU contact's first name.",
                "required,lastName,Please enter the OWU contact's last name.",
                "custom_alpha,phoneNumber,xxx-xxx-xxxx,Please enter your phone number in the format ###-###-####.",
                "required,emailAddress,Please enter the OWU contact's personal email address.",
                "reg_exp,emailAddress,.*@owu\.edu$,Please enter a valid personal OWU email address.",
                "required,emailAddressForPublication,Please enter an OWU email address for publication.",
                "reg_exp,emailAddressForPublication,.*@owu\.edu$,Please enter a valid OWU email address for publication.",
                "required,OWUSponsoringOrganizationOffice,Please enter the OWU sponsoring organization/office.",
                "required,category,Please select a category for your submission.",
                "required,submissionType,Please select whether your submission is an event or a non-event.",
                "required,OWUDailyHeadline,Please enter a headline for your OWU Daily entry.",
                "required,OWUDailyDescription,Please enter a short description for your OWU Daily entry.",
                "required,firstPublicationDate,Please select the first publication date for your OWU Daily entry.",
                "required,roomReservationAcknowledgement\[\],You must acknowledge your room reservation in order to submit this form."
                ]
            });
        

Basically, it's evaluating a particular radio button's value and then branching out via if/else to set the RSV instance displayType and rules settings and whatnot. Each branch has all of the validation rules that are needed, so in theory it should work (right?)

After I select the radio button that says it is an event, then the validation rules for event "win" (since they're lengthier?), even if I later change the radio button to be a non-event.

If my hunch about this is correct, then the fix should be for me to clear out the "rules" array somehow, but I've tried a half dozen different standard methods for array-clearing, as well as multiple different positions within the code (beyond the code that's mentioned above), but nothing seems to work.

I thought that RSV would already clear out the rules array when its defined, but apparently that's not the case?

Anyway, if anyone can provide any help with this, it would be greatly appreciated. It's one of those things that nobody noticed for nearly a year (I originally created this form last summer) but now that someone's found it, of course it has cropped up several times for various people.

Doug Thompson
Manager of Web and Electronic Communications
Ohio Wesleyan University
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)