troubleshooting Question

get The tab preloaded using coldfusion

Avatar of erikTsomik
erikTsomikFlag for United States of America asked on
Web Development SoftwareWeb Servers
6 Comments1 Solution269 ViewsLast Modified:
In my form I am using spry tabbed panel. In the first tab I have drop down(on the first tab) where I am selected the program. I want ot capture that Id of the selected program and pass it to the second tab by clicking on the second tab. How can i do that. Do i need to create a session variable. Please help this is urgent
<cffunction name="programsAction" hint="Add/Edit programs">

      <cfsavecontent variable="output">
    <cfoutput>

          <script type="text/javascript" src="/spry/includes/xpath.js"></script>
    <script type="text/javascript" src="/spry/includes/SpryData.js"></script>
    <script type="text/javascript" src="/spry/includes/SpryNestedXMLDataSet.js"></script>
    <script type="text/javascript" src="/spry/widgets/accordion/SpryAccordion.js"></script>
    <link href="/spry/widgets/collapsiblepanel/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css" />
        <script type="text/javascript" src="/spry/includes/Effect.js"></script>
    <script type="text/javascript" src="/spry/widgets/collapsiblepanel/SpryCollapsiblePanel.js"></script>
    <link href="/spry/widgets/accordion/SpryAccordion.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="/spry/includes/tmt_core.js"></script>
    <script type="text/javascript" src="/spry/includes/tmt_net.js"></script>
    <script type="text/javascript" src="/spry/includes/tmt_form.js"></script>
    <script type="text/javascript" src="/spry/includes/tmt_ajaxform.js"></script>
    <script language="JavaScript" type="text/javascript" src="/spry/widgets/tabbedpanels/SpryTabbedPanels.js"></script>
    <link href="/spry/widgets/tabbedpanels/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
          <script type='text/javascript' src='ajax/core/engine.js'></script>
                  <script type='text/javascript' src='ajax/core/util.js'></script>
                  <script type='text/javascript' src='ajax/core/settings.js'></script>
           
     
 <script type="text/javascript">
            var dsProducts2 = new Spry.Data.XMLDataSet("program.cfm","programs/program",{ useCache: false});
            
            var dsProductFeatures = new Spry.Data.NestedXMLDataSet(dsProducts2, "features/feature");
            
            </script>
    <script type="text/javascript" >
function dsRefresh2(){
    dsProducts2.loadData();
      
}

function getcurrentvalue(current){

//var current2 = document.getElementById("programlist").value;
if (dsProducts2.getDataWasLoaded()){
      
      var data = dsProducts2.findRowsWithColumnValues({'id': current}, true);
      

            if (data){

                        document.getElementById("updatePrograms").style.display='block';
                        document.getElementById("insertProgram").style.display='none';
                              document.getElementById("updateProgram").style.display='block';
                  document.getElementById("program2").value = data.program;
                  document.getElementById("Degree2").value = data.degree;
                  document.getElementById("Major2").value = data.major;
                  document.getElementById("fullname2").value = data.fullname;
                  document.getElementById("programoption2").value = data.programoption;
                  document.getElementById("fee1").value = data.fee;
                  document.getElementById("hiddenfield2").ckecked = data.hidden;
                  document.getElementById("programnote2").value = data.programnote;
                  document.getElementById("cohortname2").value = data.cohortname;
                  document.getElementById("test").value = data.id;
                  document.getElementById("idname").value= data.id;


      }
                          }
                              }
                        

                              
window.onload=function Load () {
      document.getElementById("updatePrograms").style.display='none';
      


}

function LoadShow (){
document.getElementById("insertProgram").style.display='block';
document.getElementById("updateProgram").style.display='none';
document.getElementById("updatePrograms").style.display='block';
document.getElementById("program2").value = "";
document.getElementById("Degree2").value = "";
document.getElementById("Major2").value = "";
document.getElementById("fullname2").value = "";
document.getElementById("programoption2").value = "";
document.getElementById("fee1").value = "";
document.getElementById("hiddenfield2").value.ckecked = false;
document.getElementById("programnote2").value = "";
document.getElementById("cohortname2").value = "";

            

}


         function ind (){
         var inde= document.getElementById("programlist").value
      if (inde!=''){
      document.getElementById("test").value=document.getElementById("programlist").value;
            tp1.showPanel(1);
      
      
      }
      }
      
         </script>


<cfparam name="form.school" default="">
    <cfset session.schoolcode=form.school>
       <div id="programSection">
     <cfif session.schoolcode eq "psl">
                  <h2>Program Section: Select Your Program</h2>
            <cfelse>    
                        <h2>Program Section: Select Your Area of Interest</h2>
            </cfif>    
           
            <cfoutput><p>Thank you for choosing the #session.schoolname#.<cfif session.schoolcode eq "business"> <strong>Please note that all applications to the Carey Business School should be submitted via the Web using the online application. Paper applications are no longer accepted.</strong></cfif> The information and steps that follow should help you easily navigate the online admissions process. If you have additional questions, please don't hesitate to contact us at #session.appphonenumber# or email <a href="mailto:#session.appemail#">#session.appemail#</a></p>.</cfoutput>
                  <form action="insertcategory.cfm" method="post" tmt:ajaxform="true" tmt:ajaxformcallback="dsRefresh2" name="program" >
<cfoutput>         <input type="hidden" value="#session.schoolcode#" name="school"></cfoutput>

           <div class="TabbedPanels" id="tp1">
  <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" tabindex="0">Programs</li>
    <li class="TabbedPanelsTab" tabindex="0" >Assign Requirements to the program</li>
    <li class="TabbedPanelsTab" tabindex="0" >Locations</li>
    <li class="TabbedPanelsTab" tabindex="0">Tab 4</li>
  </ul>
  <div class="TabbedPanelsContentGroup" >
     <div class="TabbedPanelsContent"> <div id="programSection">
                 <cfoutput>#timeformat(now(),"long")#</cfoutput><br>
     <div spry:region="dsProducts2" id="content">
     <cfparam name="form.programlist" default="">
     <select spry:repeatchildren="dsProducts2" spry:setrow="dsProducts2" name="programlist" id="programlist" size="15" multiple="true" onchange="getcurrentvalue(this.options[this.options.selectedIndex].value);">
 
      <option spry:if="{ds_RowNumber} == {ds_CurrentRowNumber}"  spry:select="rowSelected" value="{id}" >{webname}</option>
       <option spry:if="{ds_RowNumber} != {ds_CurrentRowNumber}" spry:select="rowSelected"  value="{id}">{webname}</option>
        </select>
     
<cfoutput>    <input type="hidden" name="idname" id="idname"></cfoutput>

        <div id="showAddProgram" onClick="LoadShow ()">[Add Program] </div>
      <div id="updatePrograms">
              
                   <!---Program--->
                 
              <div id="program">
                  <label id="label" for="program2">Program:</label>
           <span class="program1"><input type="text" id="program2" name="program2"></span>
               
           </div>
           
            <!---Degree--->
         <div id="Degree">
                  <label id="label" for="Degree">Degree:</label>
             <span class="degree1"><input type="text" id="Degree2" name="Degree2"></span>
             </div>
           
       
           
            <!---Major--->
           
             <div id="Major">
                  <label id="label" for="Major">Major:</label>
             <span class="major1"><input type="text" id="Major2" name="Major2"></span>
             
           
            </div>
           
            <!---Full Name--->
            <div id="fullname">
                  <label id="label" for="fullname">Full Name:</label>
                <span class="fullname1"><input type="text" id="fullname2" name="fullname2"></span>
               
            </div>
           
            <!---Program Option--->
            <div id="programoption">
                  <label id="label" for="programoption">Program Option:</label>
             <span class="programoption1">   <input type="text" id="programoption2" name="programoption2"></span>
             
           
            </div>
           
            <!---fee--->
           
         <div id="fee">
                  <label id="label" for="fee">Fee:</label>
                <span class="fee2"><input type="text" id="fee1" name="fee1"></span>
               
           
            </div>
           
           
           
            <!---Hidden field--->
           
             <div id="hiddenfield">
                  <label id="label" for="hiddenfield">Show/Hide:</label>
                <label for="hiddenfield">Yes</label>
               
                <span class="hiddenfield1"><input type="radio" id="hiddenfield2" name="hiddenfield" value="0" >
                 <label for="hiddenfield">No</label>
                <input type="radio" id="hiddenfield2" name="hiddenfield" value="1" checked></span>
             
                
           
            </div>

            <!---Program Note--->
           
             <div id="programnote">
                  <label id="label" for="programnote">Program Note:</label>
               <span class="programnote1"> <input type="text" id="programnote2" name="programnote2"></span>
             
            </div>
           
            <!---cohort name--->
           
             <div id="cohortname">
                  <label id="label" for="cohortname">Cohort Note:</label>
                <span class="cohortname1"><input type="text" id="cohortname2" name="cohortname2"></span>
               
            </div>
             <input type="submit" name="programAction" id="updateProgram" value="Update Program"><br />
             <input type="submit" name="programAction" id="insertProgram" value="Insert Program"><br />
<!---             <input type="submit" name="next" id="next" onclick="ind (this)">--->
           
         
             </div>
       
       </div>
       

     </div>  </div>
     
     <div class="TabbedPanelsContent" >
     
     <cfparam name="form.test" default="">
 <input  type="text" id="test" name="test" >
 <cfset session.test=form.test>
 <input type="hidden" value="#session.test#" name="test">


  <!---  <cfset session.test=form.test>--->

    <cfquery name="infoNote" datasource="HotBanana_Manager" >
         SELECT apr.reqid, apr.requirement, aprm.sortorder,apr.req_prereq,apr.hidden,ap.school_division
    FROM     trnAcademicProgramsAndRequirementsMapping aprm INNER JOIN
             trnAcademicProgramRequirements apr ON aprm.reqid = apr.reqid INNER JOIN
             trnAcademicPrograms ap ON aprm.degreeid = ap.id
WHERE ap.school_division='#session.schoolcode#' and ap.id='#session.test#'
   </cfquery>
 
     
                     
   <select name="req" id="req"  size="15" multiple="true" style=" width:550px; border:solid 1px; margin:30px 0 0 90px; padding-bottom:1cm" >
     <cfloop query="infoNote">
                <option id="#reqid#">#requirement#</option>
            </cfloop>
     </select>
 
     </div>
     <div class="TabbedPanelsContent">Tab 3 Content </div>
     <div class="TabbedPanelsContent"> Tab 4 Content</div>
  </div>
  </div>
  </div>
  </div>
  </form>
 
  <script language="JavaScript" type="text/javascript">
var tp1 = new Spry.Widget.TabbedPanels("tp1");

</script>

 
</div>




</cfoutput>
</cfsavecontent>
<cfreturn output>
</cffunction>
   
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros