Skip to main content
Participating Frequently
February 15, 2008
Question

Very simple cfselect question

  • February 15, 2008
  • 3 replies
  • 649 views
Hi,

I have a really noob question; what is the easiest way to output the values of a cfselect dropdown to a cfoutput tag on the same page?

I am only interested in puting the values of the dropdown into the cfoutput tag when the user selects on a dropdown item .


Thanks for your time.
    This topic has been closed for replies.

    3 replies

    Participating Frequently
    February 17, 2008
    Thank you very much for your help.

    I understand what I was doing wrong now.
    Participating Frequently
    February 16, 2008
    Thanks for the quick reply!

    I think what i meant to say with the code i posted is that i am perfectly happy with validating the form on the server AND i have added a submit button to my form (its just not in the code i posted) and the form is "in fact" validating to my CF8 server. However where I am stuck is that I am not sure if there is still is tricky server behavors or other code that i need to add to the form or page itself.
    In the code i posted before i still only recieve the first output selection regardless if the submit button is pressed the value of "50" always appears/reappears.

    I am still new to CF and i like it a lot but it is a little puzzling that for such a ultra-simple task as what im stuck with i hope that i dont need to write reams and reams of code to do this.

    Thank you in advance.
    Inspiring
    February 17, 2008
    quote:

    regardless if the submit button is pressed the value of "50" always appears/reappears.


    Are you asking how to to re-select a list item after the form is submitted to itself? You can use the selected attribute of cfselect. It is used to pre-select list items.


    Inspiring
    February 15, 2008
    Instead of hard coding the values, create a manual query. Then use the query to populate your cfselect and in your <cfoutput>.

    Participating Frequently
    February 16, 2008
    Thank you very much for responding so quickly as i still consider myself a beginner but im getting there; help like this is greatly appriciated.

    The code you gave me worked fine but i am still stuck with the problem that at the <cfoutput> tag, the results display ALL values from the <cfselect> dropdown and not just the selected values by the user.

    From examples in CF books and online material, it seems that my code is right, and that i dont need to add any more tags ,but obviously thats not the case.

    Thanks in advance for more help.