We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12352
    • 101 Posts
    Hi, I have a registration form with custom fields which includes a dropdown list of 3 options.

    <label for="deelname_dag">[[%register.deelname_dag]]</label>
    <select name="deelname_dag" id="deelname_dag"> 
    	          <OPTION VALUE="do" >Thursday</option>
                      <OPTION VALUE="vr" >Friday</option>
                      <OPTION VALUE="do-vr" selected>Thursday and Friday</option>
    </select>


    On the updateProfile page, is it possible to automatically select the selected option at registration?
      Don't believe anything you read on the net. Except this.
      • 12352
      • 101 Posts
      Got a working solution for smaller dropdown lists.

      On the updateProfile page I used this:

      [[!+deelname_dag:is=`do`:then=`
                  <select name="deelname_dag" id="deelname_dag"> 
      	          <OPTION VALUE="do" selected>Thursday</option>
                        <OPTION VALUE="vr" >Friday</option>
                        <OPTION VALUE="do-vr" >Thursday and Friday</option>
                  </select>`:else=``]]
      [[!+deelname_dag:is=`vr`:then=`
                  <select name="deelname_dag" id="deelname_dag"> 
      	          <OPTION VALUE="do" >Thursday</option>
                        <OPTION VALUE="vr" selected>Friday</option>
                        <OPTION VALUE="do-vr" >Thursday and Friday</option>
                  </select>`:else=``]]
      [[!+deelname_dag:is=`do-vr`:then=`
                  <select name="deelname_dag" id="deelname_dag"> 
      	          <OPTION VALUE="do" >Thursday</option>
                        <OPTION VALUE="vr" >Friday</option>
                        <OPTION VALUE="do-vr" selected>Thursday and Friday</option>
                  </select>`:else=``]]


      According the user’s profile it displays the right dropdown list, there’s always one match. Not really practical if you have a giant dropdown list with countries or something like that, probably there are better solutions...
        Don't believe anything you read on the net. Except this.
        • 38314
        • 45 Posts
        Hi,

        I found a working solution for registration and update with profil.

        1- created a Chunk [[$mydropdown]] with my options, where [[+cdz]] is my extented profile field :
        <select class="myclass" name="cdz">
          <option selected="[[+cdz]]">[[+cdz]]</option>
          <option value="myvalue1">myvalue1</option>
          <option value="myvalue2">myvalue2</option>
        </select>


        2 - insert that chunk [[$mydropdown]] in both register and updateProfile pages.
        3 - check that when creating a new account form the register page the dropdown list is empty by default, and select an option
        4 - check that in the updateProfil page, when logged in, the dropdown value shows the value entered at step #3.

        That's it ! Hope that basic solution will help !

        Notice : at step #4 the first value of the dropdwon list will also appears in the list at his normal place, as this tip isn't dynamic.
          • 34103
          • 47 Posts
          [solved] Doesn't work for me. The value is still blank. Need an additional control box.

          Solution: Syntax Error. [ed. note: istvan.velsz last edited this post 14 years, 8 months ago.]