We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18270
    • 68 Posts
    Hi all,
    How would one go about making a template variable that will only allow a certain type on input. Lets say for example I want a template variable called "Code" which must not match the code of any other resource with the same code value set. To make it a little more complicated lets also assume we would like to strip out non alpha numeric characters from a string that is entered into this "Code" template variable (sort of like what the resource alias already does I guess).

    Any code examples or extras out there that do this type of thing that I can get some inspiration off?

    Thanks!

      • 3749
      • 24,544 Posts
      This might get you started: https://forums.modx.com/index.php/topic,52539.0.html.


      ---------------------------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
      MODx info for everyone: http://bobsguides.com/modx.html
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 18270
        • 68 Posts
        Thanks for the tip BobRay, I'll follow through these threads. I thought perhpas the custom tv might be what I needed to look at.

        Cheers