3 Replies Latest reply on Oct 7, 2009 1:21 PM by Günter Schenk

    wdg:valuefield="add 2 fields here"?

    JMCC1982

      Hi

       

      Is there a way for me to add to fileds to the dependent dropdown?

       

      check bold part, i want to display both the name and the count.

       

      <select name="city" id="city" wdg:subtype="DependentDropdown" wdg:type="widget" wdg:recordset="city" wdg:displayfield="name_city; COUNT(id)" wdg:valuefield="name_city COUNT(id)" wdg:fkey="prov_city" wdg:triggerobject="province">
              <option value="Select One">Select One</option>

        • 1. Re: wdg:valuefield="add 2 fields here"?
          Günter Schenk Level 4

          I´m moving this thread to the Dreamweaver Developer Toolbox (ADDT) PHP Application Development forum

          • 2. Re: wdg:valuefield="add 2 fields here"?
            Günter Schenk Level 4

            JMCC1982 wrote:

             

            Hi

             

            Is there a way for me to add to fileds to the dependent dropdown?

             

            check bold part, i want to display both the name and the count.

             

            <select name="city" id="city" wdg:subtype="DependentDropdown" wdg:type="widget" wdg:recordset="city" wdg:displayfield="name_city; COUNT(id)" wdg:valuefield="name_city COUNT(id)" wdg:fkey="prov_city" wdg:triggerobject="province">
                    <option value="Select One">Select One</option>

            COUNT(columnname) is a query function only and will do nothing when used outside a query. In this case you´ll need to create an "alias" within the query, example:

             

            "SELECT field_one, field_two, COUNT(id) AS count_id ..."

             

            ..and use the alias "count_id" for the widget´s displayfield attribute like this:

             

            wdg:displayfield="name_city; count_id"

             

            wdg:valuefield="name_city COUNT(id)"

             

            I wonder what this is supposed to do, because the contents of the "valuefield" attribute is usually meant to only submit an integer value to the database, say, the id_city

             

            Cheers,

            Günter

            • 3. Re: wdg:valuefield="add 2 fields here"?
              JMCC1982 Level 1

              Hi

               

              I was able to do sql-> concat() as name_count and then just displayed that custom field

               

              Thanks for your help.

               

              Jay