Greetings all,
I am looking for some advice on improving my donor experience with the contributions page in TNEW. The biggest thing I am missing currently is the ability to make fields appear or disappear based on other selections. For example if someone checks the box indicating that their gift will be matched by their company, then a whole collection of fields should appear that allow them to fill in pertinent info. I have been told that TNEW (my current version is 6) is not capable of doing this.
OK so my next solution was to build my own form in a CMS to capture field data, including all those custom options and simply have my form pass the variables over to TNEW for process. But TNEW does not accept variables in the URL for all but a short list of items like contrib_type, suggested amount, promo codes, etc.
So my next step is now to try and code in javascript or something to force the show/hide options I want, but it sounds like a nightmare to test across platforms and situations. Not to mention that I know very little about javascript to begin with.
So I need some advice. My form needs to be simple and not scary in any way for people trying to generously donate to us and I need to figure out a way to make it happen.
Any help would be appreciated.
We are on TNEW version 6, and I do a ton of front-layer JavaScript to make display teaks like this.
https://fishercentertickets.bard.edu/dev/contribute.aspx?don=3&fieldAmt=
Two of the checkboxes on this page have extra form elements that display when the box is checked. Feel free to look through the page source and steal whatever you want. I'm also using a small toolkit I developed to make these tweaks easier, which I presented at TLCC this year:
TNEW Magic (DIG EDU GRP IT MBR MKT TKT)
LEARN JAVASCRIPT!
This is brilliant. I intend to "borrow" your honor/memorial and matching code specifically.
Is the code dropped right into the custom field code? I seem to remember that this was a bad idea based on your presentation materials.
I am a tweaker rather than a coder. Would I build this as a separate file to be called from my main CSS file?
Thanks very much for your excellent code!
Yes, dumping JavaScript into content fields is antirecommended. Hopefully you can edit your TNEW template. You can include a script block in the template HTML, or source a separate .js file. If you use any of my snippets without the whole TNEWKit library, you'd want to wrap them in a jQuery $(document).ready() call so they don't fire until after the page is fully loaded.