WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Event Registration] Required registration questions not validated (10 posts)

  1. robanna
    Member
    Posted 5 years ago #

    I set up a few event questions under regform setup and set them to be required and left the value blank, but when I go to the form and click Submit, those fields do not get validated. It pass the blank value on with out an alert. Does anyone have a fix for this? I need attendees to select a t-shirt size (dropdown) and they also have to agree to a release form (single check box).

    Thanks-
    Rob

  2. solidariti
    Member
    Posted 5 years ago #

    Can you post the form?

  3. robanna
    Member
    Posted 5 years ago #

    solidariti,
    Not really - it's private post on a live site.
    Maybe if you could PM me I could set up a use for you to go have a look at it. Do you think you'd have time?

    Thanks-
    Rob

  4. cpetzny
    Member
    Posted 5 years ago #

    Hi,

    I'm having the same problem. I have a couple of custom fields, one of which is required, but I can submit the form without any messages. I have dissected the form validation javascript in the plugin PHP, but I've had no luck. I am using the out of the box files without modifications. The class for the form field is correct (class="r"), but the javascript does not seem to execute properly on form submit.

    I am using WordPress 2.7.1 and viewing pages in Firefox 3.0.7. The issue also occurs in Safari 3.2.1

    I really need this to work, it's an RSVP form for my brother's wedding site

    Cheers,
    Chris

  5. avdude
    Member
    Posted 5 years ago #

    My apologies on this. There is a bug with adding additional questions and validation that I have not yet been able to resolve. I am working on this and hope to have it resolved very soon.

  6. jmcyclist
    Member
    Posted 5 years ago #

    Does anyone know if this is this resolved in the new version?

  7. jmcyclist
    Member
    Posted 5 years ago #

    Any luck on this validation issue avdude?

  8. linuxcentre
    Member
    Posted 5 years ago #

    I have a fix for this:

    --- event-registration/event_register_attendees.inc.php-orig 2009-05-05 22:23:41.000000000 +0000
    +++ event_register_attendees.inc.php-new      2009-05-11 11:13:24.000000000 +0000
    @@ -204,11 +204,14 @@
            return null;
     }
    
    +
                    //alert("your trying to submit");
    -               var inputs = $A(form.getElementsByTagName("input"));
    +               var inputs = form.getElementsByTagName("input");
                    var msg = "";
    -               var radioChecks = $H();
    -               inputs.each( function(e) {
    +               var radioChecks = new Array();
    +               var e;
    +               //inputs.each(
    +               for( var i = 0, e; e = inputs[i]; i++ ) {
                            var value = e.value ? trim(e.value) : null;
                            if (e.type == "text" && e.title && !value && e.className == "r") {
                                    msg += "\n " + e.title;
    @@ -218,16 +221,20 @@
                                    if (e.type == "checkbox") name = name.substr(0, name.lastIndexOf("-"));
                                    if (e.checked == false && ((!radioChecks[name]) || (radioChecks[name] && radioChecks[name] != 1))) {
                                            radioChecks[name] = e;
    +                                       //alert("your trying to submit " + name + "title:" + e.title);
                                    } else {
                                            radioChecks[name] = 1;
                                    }
                            }
    -               });
    -               radioChecks.each( function(e) {
    -                       if (typeof(e) == "object" && e.value != 1) {
    -                               msg += "\n " + e.value.title;
    +               }
    +
    +               for (var name in radioChecks) {
    +                       var e = radioChecks[name];
    +                       if (typeof(e) == "object" && e != 1) {
    +                               msg += "\n " + e.title;
                            }
    -               });
    +               }
    +
                    if (msg.length > 0) {
                            msg = "The following fields need to be completed before you can submit.\n\n" + msg;
                            alert(msg);
  9. linuxcentre
    Member
    Posted 5 years ago #

    Looks like the backticks still mangled the patch. Try replacing the ampersands as appropriate....

  10. avdude
    Member
    Posted 5 years ago #

    I have posted a valid fix for the validation that works. It is at http://edgetechweb.com/registration-form-validation/

    additionally I have written more detail instructions and provided better screen shots.

Topic Closed

This topic has been closed to new replies.

About this Topic