School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,136 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,006 people online right now. Registration is fast and FREE... Join Now!




CFForm not working inside CFLayoutArea-Tab which is inside of CFDiv

 

CFForm not working inside CFLayoutArea-Tab which is inside of CFDiv

xheartonfire43x

5 Nov, 2009 - 09:17 AM
Post #1

D.I.C Regular
***

Joined: 22 Dec, 2008
Posts: 267



Thanked: 2 times
My Contributions
Okay so here is a really odd situation that I am not sure what to do with. I have a CFTextarea and CFInput-Datefield inside a CFForm which resides in a CFLayoutArea-Tab which the CFLayout resides in a CFDiv. Let me explain why this goes so deep.

The CFLayoutArea-Tab has 2 information tabs, and 2 form tabs. Obviously the forms submit data that appears in the information tabs. The title of the information tabs displays the record count for the amount of records in the tab. So what I did was the CFDiv refreshes when someone submits a form. That way the totals in the title refresh rather than just the content.

That is why the CF Ajax goes so deep.

Anyways only one of the 2 forms uses CFForm Ajax form fields (CFTextarea, CFInput-Datefield). When the page loads and I click to the form tab it displays a message in the CFDebug window: error:http: Error processing JavaScript in markup for element AddTime:

Then it also displays a popup that it could not find CF_textarea*blah blah blah*. I have CFAJaxImport tags in both the page that holds the CFDiv tag and the page that holds the CFLayout.
If when I remove the CFDiv and use a CFInclude instead i get the same thing.

CODE

<!---tickDetails.cfm--->
<cfajaximport tags="cfform,cfinput-datefield,cftextarea,CFLAYOUT-TAB,cfdiv"/>
<!---<cfdiv id="TicketWrap" bind="url:models/view_ticketwrap.cfm?id=#url.id#" />--->
<cfinclude template="view_ticketwrap.cfm" />
<!---view_ticketWrap.cfm --->
<cfajaximport tags="cfform,cfinput-datefield,CFLAYOUT-TAB,cftextarea"/>
<cflayout tabposition="top" name="TicketInfo" type="tab" style="width:100%;"  >
    <cflayoutarea name="Replies" selected="#RepliesSelected#" title="Replies (#getresponses.recordcount#)" source="models/view_replies.cfm?id=#url.id#" refreshonactivate="true" />
    <cfif getTicket.completed NEQ 'Y'><cflayoutarea name="AddReplies" title="Add Reply " source="models/frm_addReply.cfm?id=#url.id#" refreshonactivate="true" /></cfif>
    <cflayoutarea name="RecordedTime" selected="#AddTimeSelected#" title="Recorded Time (#hours#)" source="models/view_time.cfm?id=#url.id#" refreshonactivate="true" />
    <cfif getTicket.completed NEQ 'Y'><cflayoutarea name="AddTime" title="Submit Time" source="models/view_submitTime.cfm?ticketid=#URL.id#&subject=#getTicket.subject#" refreshonactivate="false" /></cfif>
</cflayout>
<!--- view_submitTime.cfm --->
<cfform name="submitTime" action="/controllers/tickets.cfm">
    <input type="hidden" name="process" value="submitTime">
    <cfinput type="hidden" name="ticketID" value="#ticketID#">
    <cfinput type="hidden" name="memberID" value="#memberID#">
    <cfinput type="hidden" name="subject" value="#subject#">
    <table cellpadding="3" cellspacing="0" border="0" width="95%" align="center">
        <cfif structKeyExists(SESSION,'message')>
            <tr>
                <td colspan="2"><span class="Alert">#SESSION.message#</span></td>
            </tr>
            <cfset structDelete(SESSION,'message')>
        </cfif>
        <tr>
            <td>Time Spent:</td>
            <td>
                <cfinput type="datefield" name="time_date" value="#time_date#">&nbsp;&nbsp;
                <select name="time_hr">
                    <cfloop from="0" to="24" index="hour">
                        <option value="#hour#" <cfif time_hr EQ hour>selected</cfif>>#hour#</option>
                    </cfloop>
                </select>:
                <select name="time_min">
                    <option value="0" <cfif time_min EQ 0>selected</cfif>>00</option>
                    <option value="25" <cfif time_min EQ '25'>selected</cfif>>15</option>
                    <option value="5" <cfif time_min EQ '5'>selected</cfif>>30</option>
                    <option value="75" <cfif time_min EQ '75'>selected</cfif>>45</option>
                </select>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                Was this work done on-site?    <cfinput type="checkbox" name="onsite" value="true" checked="#IIf(onSite EQ true,true,false)#">
            </td>
        </tr>
        <tr>
            <th colspan="2" align="left">What work was done?</th>
        </tr>
        <tr>
            <td colspan="2">
                <cftextarea richtext="true" name="workDone" id="workDone" toolbar="Basic" width="468" height="200" skin="silver" value="#workDone#" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <cfinput type="submit" value="Submit Time" name="submit"/>
            </td>
        </tr>
    </table>
</cfform>
</cfoutput>


I did not present the entirety of code in the snippet but the stuff pertaining to the problem is there.

User is offlineProfile CardPM
+Quote Post


ecuscotty

RE: CFForm Not Working Inside CFLayoutArea-Tab Which Is Inside Of CFDiv

11 Nov, 2009 - 10:12 AM
Post #2

New D.I.C Head
*

Joined: 14 Oct, 2009
Posts: 40



Thanked: 5 times
My Contributions
Yea, things can get kinda weird when you start to nest the ColdFusion 8 Ajax layout features.

I had a similar problem. I got around it by using yet more of ColdFusion 8's Ajax features namely the ColdFusion.Ajax.submitForm function. Here is a nice tutorial on how to use it...

http://cfsilence.com/blog/client/index.cfm...Form-Submission

Hope it helps.
User is offlineProfile CardPM
+Quote Post

xheartonfire43x

RE: CFForm Not Working Inside CFLayoutArea-Tab Which Is Inside Of CFDiv

11 Nov, 2009 - 11:03 AM
Post #3

D.I.C Regular
***

Joined: 22 Dec, 2008
Posts: 267



Thanked: 2 times
My Contributions
QUOTE(ecuscotty @ 11 Nov, 2009 - 10:12 AM) *

Yea, things can get kinda weird when you start to nest the ColdFusion 8 Ajax layout features.

I had a similar problem. I got around it by using yet more of ColdFusion 8's Ajax features namely the ColdFusion.Ajax.submitForm function. Here is a nice tutorial on how to use it...

http://cfsilence.com/blog/client/index.cfm...Form-Submission

Hope it helps.


Thanks for the link to the tutorial, I have been wanting to learn how to properly use ColdFusion.Ajax.submitForm for a while, but never got up to it. My issue actually ended up being some bad files in the scripts folder along with some messed up files in my internet browser install folders... I replaced them and everything ran fine.

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 02:50PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month