Hi All,

I'm attempting to add any number of a specific tab within a tab environment 
that is itself dynamic upon initial build. The 2 problems I'm having:

1) If I add a new tab and then a second, the imported content file gets 
duplicated within the second addition's tab space and periodically, the first 
tab added will not be clickable.

2) I need to dynamically give the input fields being imported from 
tabTest130_2.cfm their own unique ids and cannot figure out how to do this. I 
managed to assign a unique id to the tablayoutarea I created which uses the 
javascript function "handleTab()". 

Maybe the cflayout and cflayoutarea is the wrong tool to use here, but I've not 
found any examples of other tools that would allow me to do the same thing 
either.

Any help, suggestions or even being pointed in a new direction is greatly 
appreciated.

Thanks, Randy

Here is the code:

TabExample2.cfm (this is the main form)
<html>
<head>
        <title>Tab Example</title>
        <script type="text/javascript">
                function handleTab(tcID) {
                        var tabVal = parseFloat(document.getElementById('myVar' 
+ tcID).value);
                        document.getElementById('myVar' + tcID).value = tabVal 
+ 1;
                        var divNode = document.getElementById('loa130_ZZZ_' + 
tcID); 
                        divNode.id = 'loa130_' + tabVal + '_' + tcID;
                }
        </script>
</head>

<body>
<cfform name="TaxCalc">
        <cflayout type="border" name="myLayout">
                <cflayoutarea name="header" position="top">Header information 
goes here</cflayoutarea>
                <cflayoutarea name="masterArea" position="center">
                        <cflayout name="masterTab" type="tab">
                                <cfloop from="2008" to="2010" index="i">
                                        <cfoutput>
                                                <cflayoutarea name="loa#i#" 
title="#i#">
                                                        <input type="hidden" 
name="myVar#i#" id="myVar#i#" value="4">
                                                        <cfset myVar = 4>
                                                        <input type="button" 
name="Add_130_#i#" value="Add Form 130" 
                                                                
onclick="ColdFusion.Layout.createTab('lo130_#i#','loa130_ZZZ_#i#','Location','tabTest130_2.cfm?j=#myVar#;TC_ID=#i#');handleTab(#i#);"
 
                                                                
style="float:right;">
                                                        <cflayout name="lo#i#" 
type="tab"><br />
                                                                <cflayoutarea 
name="loa1040_#i#" title="Form 1040 Adjustments &amp; Changes">
                                                                        
<cflayout name="lo1040_#i#" type="tab"><br />
                                                                                
<cflayoutarea name="loa1040_1_#i#" title="Exemptions & Misc"><br />#i# 
Exemptions & Misc goes here</cflayoutarea>
                                                                                
<cflayoutarea name="loa1040_2_#i#" title="Changes"><br />#i# Changes goes 
here</cflayoutarea>
                                                                                
<cflayoutarea name="loa1040_3_#i#" title="Adjustments"><br />#i# Adjustments 
goes here</cflayoutarea>
                                                                                
<cflayoutarea name="loa1040_4_#i#" title="Other Changes"><br />#i# Other 
Changes goes here</cflayoutarea>
                                                                                
<cflayoutarea name="loa1040_5_#i#" title="Contributions"><br />#i# 
Contributions goes here</cflayoutarea>
                                                                                
<cflayoutarea name="loa1040_6_#i#" title="Credits"><br />#i# Credits goes 
here</cflayoutarea>
                                                                        
</cflayout>
                                                                </cflayoutarea>
                                                                <cflayoutarea 
name="loa126_#i#" title="Form 126"><br />#i# Form 126 goes here</cflayoutarea>
                                                                <cflayoutarea 
name="loa130_#i#" title="Form 130">
                                                                        
<cflayout name="lo130_#i#" type="tab">
                                                                                
<cflayoutarea name="loa130_1_#i#" title="Location 1"><br />#i# Location 1 goes 
here</cflayoutarea>
                                                                                
<cflayoutarea name="loa130_2_#i#" title="Location 2"><br />#i# Location 2 goes 
here</cflayoutarea>
                                                                                
<cflayoutarea name="loa130_3_#i#" title="Location 3"><br />#i# Location 3 goes 
here</cflayoutarea>
                                                                        
</cflayout>
                                                                </cflayoutarea>
                                                                <cflayoutarea 
name="loa2210_#i#" title="Form 2210"><br />#i# Form 2210 goes 
here</cflayoutarea>
                                                                <cflayoutarea 
name="loaPA_#i#" title="Payments"><br />#i# Payments goes here</cflayoutarea>
                                                                <cflayoutarea 
name="loaAD_#i#" title="Activity Detail"><br />#i# Activity Detail goes 
here</cflayoutarea>
                                                        </cflayout>
                                                </cflayoutarea>
                                        </cfoutput>
                                </cfloop>
                                        
                                <cflayoutarea title="Summary" 
name="loaSummary"><br />Summary goes here</cflayoutarea>
                                <cflayoutarea title="Correspondence" 
name="loaCorrespondence"><br />Correspondence goes here</cflayoutarea>
                        </cflayout>
                </cflayoutarea>
                
        </cflayout>
</cfform>

</body>
</html>


tabTest130_2.cfm (this is the file that is being called in.) <h3>New 
Location</h3> <table border="1" cellpadding="3" cellspacing="0" width="100%">
        <tr>
                <td>Location Name: </td>
                <td>
                        <input type="text" maxlength="50" value="" 
                        name="f130_#j#_NAME_LOCATION_#TC_ID#"
                        id="f130_#j#_NAME_LOCATION_#TC_ID#">
                </td>
        </tr>
        <tr>
                <td>Total Amount: </td>
                <td>
                        <input type="text" value=""
                        name="f130_#j#_TOTAL_AMOUNT_#TC_ID#" 
                        id="f130_#j#_TOTAL_AMOUNT_#TC_ID#">
                </td>
        </tr>
</table>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:348428
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to