macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

How to fix this....need help pls

Subject: How to fix this....need help pls
From: "Adomacro"
Date: Wed, 8 Aug 2007 18:22:19 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
I don't know, what i am doing wrong here..

 How can i fix this....

 My dropdown is not holding values, if i have more records on 
tab_student_details.

 All Dropdown default to first dropdown value...i am not sure why.

 How to correct his code?.



 <cfquery name="student_details_q" datacourse="#dsn#">
        select studid,course_selected,Course_credit,Course_Fee
        from tab_student_details
 </cfquery>


 <cfquery name="course_q" datacourse="#dsn#">
        select course,credit
        from tab_course
 </cfquery>


 <cfif student_details_q.recordcount gt 0>
        <cfset editcount = 1>
        <input type="hidden" name="student_details_q_recordcount" 
value="<cfoutput>#student_details_q.recordcount#</cfoutput>">
        <cfoutput query="student_details_q"> 
                <tr>
                        <td>
                                <select name="Course_#editcount#" 
onChange="document.forms['Course_frm'].Course_credit_#editcount#.value=this.valu
e.substring(0,this.value.indexOf(','));"> 
                                        <option value=""></option>
                                        <cfloop query="course_q" startrow="1" 
endrow="#course_q.recordcount#">
                                                <option 
value="#credit#,#course# <cfif 
#student_details_q.course_selected# eq 
#course#>selected</cfif>>#course#</option>                                      
                                        
                                        </cfloop> 
                                </select>
                        </td> 
                        <td>                                            
                                <input type="text" 
name="Course_credit_#editcount#" 
value="#student_details_q.Course_credit#" size="2" maxlength="2">
                        </td>                                           
                        <td>
                                <input type="text" 
name="Course_Fee_#editcount#" 
value="#student_details_q.Course_Fee#" size="9" maxlength="9">
                        </td>                                                   
                                
                </tr>
        <cfset editcount = editcount + 1>
        </cfoutput>
 </cfif>

 -------------------
 Action page : looping and inserting...works fine.


<Prev in Thread] Current Thread [Next in Thread>