We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21417
    • 486 Posts
    Hello,

    I need the quick help of a modx eform / jquery guru.

    I have an email form which I have set up to use jquery.validate for required fields (I like ajax form validation).

    1. It appears to work well on screen but for the "boxes" category.

    The scenario I need to get working is:
    + the Boxes category is required
    + a minimum of 1 can be selected
    + a maximum of 4 can be selected (eg all options)

    The extras category is dependent on one of the boxes being selected.

    Hopefully you get the gist from the demo:
    (link removed)

    With my present demo, name="boxes" works for one - but only one of these is sent through with the Eform Report - Basically I need one to be required - and any selections to be sent through with the Eform Report.

    If I change name="boxes1", name="boxes2" etc - it doesn’t link with the extras category.

    My jquery.validate javascript is here:
    (link removed)


    2.
    While you are at it, how much also to write a little jquery genius for the mobile number field so that it accepts numbers, spaces, brackets() and the + symbol (for Australian phone numbers):
    + any configuration really, I don’t mind which order the characters can be place in, just that those will work
    + a minimum on 6 characters should be required
    eg 88 8888 8888
    eg (88) 8888 8888
    eg 8888888888
    eg + 88 8 8888 8888
    eg 8888 888 888


    There is a file that comes with jquery.validate called additional methods.js which shows that these tweaks can be made - here is an example for UK phone format.

    jQuery.validator.addMethod(’phoneUK’, function(phone_number, element) {
    return this.optional(element) || phone_number.length > 9 &&
    phone_number.match(/^(\(?(0|\+44)[1-9]{1}\d{1,4}?\)?\s?\d{3,4}\s?\d{3,4})$/);
    }, ’Please specify a valid phone number’);

    I would like the code that can be pasted directly into my (link removed)
    file.


    Please provide an itemised quote (for 1 and 2) to work your magic.

    I prefer to pay with paypal.

    I am able to provide all relevant eform and jquery files etc once terms are agreed upon, but would prefer not to give server access if at all possible.

    Thanks in advance.

    Nick
      Web design Adelaide
      http://gocreate.com.au

    This discussion is closed to further replies. Keep calm and carry on.