Problem with <cfselect

Reply

Join Date: Dec 2008
Posts: 2
Reputation: swskpper is an unknown quantity at this point 
Solved Threads: 0
swskpper swskpper is offline Offline
Newbie Poster

Problem with <cfselect

 
0
  #1
Dec 9th, 2008
I am a newbie and hope that someone can help. I have a <cfform that adds and updates records. I have 3 <cfselect statements that are dynamic. I user the selected attribute to display the current value if this is an update. The first one works fine.

The 2nd and 3rd will not show the current value when updating. They both show the initial value. The values are saved in the table correctly. The values are not related. Here is a sample of 2 of the selects.

  1. <td>
  2. <cfselect enabled="No"
  3. name="dept_code"
  4. size="1"
  5. id="dept_code"
  6. required="yes"
  7. message="Please select a Valid Department Code"
  8. multiple="no"
  9. query="list_active_depts"
  10. value="dept_code"
  11. display="dept_code_desc"
  12. selected="#user_dept_code#" onChange="#user_dept_code#"
  13. queryPosition="Below">
  14. </cfselect>
  15. </td>
  16. <tr>
  17. <td>
  18. <cfselect name="Fstp_code"
  19. size="1" id="Fstp_code"
  20. required="yes"
  21. message="Please select a Valid FSTP Code"
  22. multiple="no"
  23. query="list_active_fstp"
  24. value="fstp_code"
  25. display="fstp_code_desc"
  26. queryPosition="below"
  27. selected="#user_fstp_code#" onChange="#User_fstp_code#">
  28. </cfselect>

Any help would be greatly appreciated.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 45
Reputation: arrgh is an unknown quantity at this point 
Solved Threads: 6
arrgh arrgh is offline Offline
Light Poster

Re: Problem with <cfselect

 
0
  #2
Dec 10th, 2008
Did you verify the "selected" values actually exist in the query?

Other than that the code looks okay except for the onChange. OnChange accepts javascript/actionscript. But it looks like you are passing in the selected value instead, which probably wouldn't work.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 2
Reputation: swskpper is an unknown quantity at this point 
Solved Threads: 0
swskpper swskpper is offline Offline
Newbie Poster

Re: Problem with <cfselect

 
0
  #3
Dec 11th, 2008
I took out the "onchange" and the 2nd cfselect began working. I believe that the values for the 3rd select are populated. I am trying to make sure of that now.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 20
Reputation: jedimatt is an unknown quantity at this point 
Solved Threads: 1
jedimatt jedimatt is offline Offline
Newbie Poster

Re: Problem with <cfselect

 
0
  #4
Jan 9th, 2009
Hi,

You may be better off using the bind attribute to link multiple selects together.

Have a look at Ben Fortas example using linked selects
url: http://www.forta.com/blog/index.cfm/...elated-Selects

This is new functionalty in CF8.

rgds

JM
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ColdFusion Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC