ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

problems with validation date fields in form

July 16, 2012 6:19am

Subscribe [1]
  • #1 / Jul 16, 2012 6:19am

    Franka

    54 posts

    ExpressionEngine v2.4.0 - Build: date 20120123
    Freeform 3.1.3
    Matrix 2.2.4Enabled
    P&T Field Pack 1.0.3
    SafeCracker 2.1
    Wiki 2.3

    Hi,

    I’ve made 2 freeforms I need to check/validate some fields that are required.
    It’s about events I need a begindate and an enddate. Begindate has to be the same as today or later and the enddate has to be the same as begindate or later.
    Begin and enddate are dropdown/select field. I also want the error code on the same page to be shown behind the field.
    I do like to get a hint how to do that.

    answer form solspace:

    Unfortunately this kind of validation is not possible in Freeform. The only validation in Freeform is checking if the field is required and filled out.

    I suggest using a javascript solution for validating your form and having inline error messages. I have a preference for Bassistance’s jquery validation script (http://bassistance.de/jquery-plugins/jquery-plugin-validation/), but there might be other jQuery/javascript plugins that come in handy

    I tried jquery but I can’t seem to get it working.

    I put this in my header:

    [removed][removed]
    [removed][removed]
    [removed][removed]
    
    [removed]
    $(document).ready(function() {
       $("#commentForm").validate({meta: "validate"});
       $("#commentForm2").validate();
       $("#commentForm3").validate({
          messages: {
             email: {
                required: 'required field!'
             }
          }     
       });
    
    });
    [removed]

    I put this in my form:

    <input type="text" name="email" size="50" class="{required:true, email:true, messages:{required:'e-mail required', email:'vali email is required}}" /></td>

    Can someone help me please

    greetings,

    Franka


    Ps By mistake I first put this topic in General Discussion and I don’t know how to change that so I just copied my topic here. This whole list of fora is not transparant for a newbie.

     

  • #2 / Jul 17, 2012 3:07pm

    Kevin Smith

    4784 posts

    Hi Franka,

    While we’re not able to work out JavaScript/jQuery issues with you, I’d be more than happy to move this thread over to Community Help so that others who might be more familiar with the jQuery script you’re using can toss in and help. Would you like me to do that?

  • #3 / Jul 17, 2012 3:10pm

    Franka

    54 posts

    yes please

  • #4 / Jul 17, 2012 3:12pm

    Kevin Smith

    4784 posts

    Sure thing!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases