We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25307
    • 114 Posts
    First, please note that I’ve looked and been unable to find anything in the resource directory that handles what I am interested in - but I overlook very useful things all the time. So if anyone knows of any work that has been done along these lines, please pass it on.

    I want to integrate some advanced (client-side) form validation methods, similar to http://tetlaw.id.au/view/javascript/really-easy-field-validation"" target="_blank" rel="nofollow">DexagogoReally easy field validation - this method uses some elements of Prototype for animating its warning/confirmation classes and uses validation based on the wForms kit I believe.

    That leads me to the question of what library to start from. Mootools is already being utilized - perhaps there, but I’m not certain that the mootools elements used by MODx include form validation functions. Please excuse my MODx youth here, but my next question is what would be the best way to approach this task within the framework. Snippet or Plugin? Do I hack up or add on to eForm, or start from scratch?


    This doesn’t seem like anything that should drive me this nutz. I’m pretty sure this shouldn’t be that hard to do the right way. I’ve stylized client-side validation of forms several times, with a few different JS libraries and scripts - just not yet within MODx.

    Thanks in advance for any workflow/framework tips or resources on how to approach scenarios like this in MODx and avoid hacking a bunch of stuff into the system unconventionally, and thanx to anyone that helps me get started.
      • 4041
      • 788 Posts
      I used this javascript validation before and it works pretty good, maybe give it a try and see... have a look at the examples page to see if it suits you smiley

      http://www.mjslib.com/doc/index.html

      In particular I used the formval.js code and from the looks of it apparently has matured a bit since I used it, back then you hard coded the error messages in the js file, now it is added to the input fields themselves.
        xforum
        http://frsbuilders.net (under construction) forum for evolution
        • 25307
        • 114 Posts
        thanx for the feedback breezer. looks like that lib, as well as one of a gazillion others, would do the trick validation wise. I guess maybe my question more newbish than I explained.. I’m looking for, procedurally, the best way to integrate a js library and accompanying features such as that one into the modx data flow.. for example, most appropriate methods to include the required lib (js file(s)), dynamic insertion of code to trigger form interactive events like onBlur and onFocus, smart assignment of selectors and classes to elements, integrating with eForm (which is killer btw!), and so on yada yada. big ups for your help and any more that trickle in at the charity of a freshly addicted modx newb. smiley