On Sat, Nov 1, 2008 at 8:07 PM, Aaron Rouse <aaron.rouse@...> wrote:
I was wondering if anyone has used qForms within a Model Glue 2 application? I keep getting a this.obj.elements is undefined error in FireFox. If I copy the browser source into a new stand alone HTML file and run it then I do not get the error. It seems like the approach I am taking is loading up the files within the header tags more than once, I think that because I added an alert() in there and got the Ok box more than once.In my first attempt I added a value tag within the include tag for my display template, all of this within the ModelGlue.xml file. So I had an event handler like this:<event-handler name="contactForm"><views><include name="body" template="frmContact.cfm"><value name="xe.contact" value="contactFormAction" /><value name="flgQforms" value="true" /></include></views><results><result do="view.template" /></results></event-handler>Then within my dspTemplate.cfm that I had something like this:<cfset qForms = viewstate.getValue("flgQforms", false) />...<head><cfif Variables.qForms><script src="/assets/js/qForms/qforms.js"></script><script language="JavaScript"><!--//// set the path to the qForms directoryqFormAPI.setLibraryPath("/assets/js/qForms/");// this loads all the default librariesqFormAPI.include("*");//--></script></cfif></head>Then at the bottom of the specific view, frmContact.cfm which houses just the form itself, I had this:<script language="javascript"><!--//// initialize the qForm objectobjForm = new qForm("Form");// make these fields requiredobjForm.required("UserName,UserEmail,Subject,Body");//--></script>I even tried moving the stuff out of my dspTemplate and into my frmContact.cfm but got no change. I also even tried moving the script from the bottom of the frmContact.cfm to the bottom of the dspTemplate where it would be put in after the form but still no change.Here is the exact error from FireFox:--
Aaron Rouse
http://www.happyhacker.com/
--
Aaron Rouse
http://www.happyhacker.com/