Search the web
Sign In
New User? Sign Up
qformsapi · qForms API: qForums
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
qForms and Model Glue 2?   Message List  
Reply | Forward Message #3957 of 3977 |
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 directory
qFormAPI.setLibraryPath("/assets/js/qForms/");
// this loads all the default libraries
qFormAPI.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 object
objForm = new qForm("Form");
 
// make these fields required
objForm.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:

this.obj.elements is undefined
_q_init()v3X06PoP...BUg%3D%3D (line 1)
qForm("Form", undefined, undefined)v3X06PoP...BUg%3D%3D (line 1)
(?)()

--
Aaron Rouse
http://www.happyhacker.com/


Sun Nov 2, 2008 1:07 am

aaron_rouse
Offline Offline
Send Email Send Email

Forward
Message #3957 of 3977 |
Expand Messages Author Sort by Date

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...
Aaron Rouse
aaron_rouse
Offline Send Email
Nov 2, 2008
1:07 am

ugh ... guess it helps if I copied the entire source from the browser when testing. I stripped out the CF debug information when I tested in a stand alone...
Aaron Rouse
aaron_rouse
Offline Send Email
Nov 2, 2008
1:21 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help