We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5578
    • 15 Posts
    Hi everybody,

    I have trouble with my select box, using webloginPE.

    In a form, i have

    <label id="wlpeInvestorTypeLabel" for="wlpeInvestorTypeLabel"><span class="required">*</span> Investor type

    <select id="wlpeInvestorTypeLabel" name="investorType">
    <option value="Family office">Family office</option>
    <option value="Private bank">Private bank</option>
    <option value="Investment advisor">Investment advisor</option>
    <option value="Pension fund">Pension fund</option>
    <option value="Endowment">Endowment</option>
    <option value="Other">Other</option>
    </select>
    </label>

    i select a value, but i have an error in my form, it’s ok.

    but when the form reload, the value of my select disappear, i have the first option of value...

    Can you help me ? Thanks a lot
      • 5578
      • 15 Posts
      Hi it’s ok for me, i’ve used javascript.

      If somebody is interested, i show the "complicate" solution.

      Bye !
        • 26931
        • 2,314 Posts
        yes, why not smiley ... show us your solution
          • 5578
          • 15 Posts
          function getOptionValueInvestor(obj){
          index = document.wlpeUserRegisterForm.investorType.selectedIndex;
          document.wlpeUserRegisterForm.selectedProfil.value=index;
          }

          function loadSelected(){
          document.getElementById("investorTypeId").selectedIndex = document.wlpeUserRegisterForm.selectedProfil.value;
          }


          <input type="hidden" name="selectedProfil" value="[+post.selectedProfil+]" />

          <select id="investorTypeId" name="investorType" onChange="getOptionValueInvestor(this);">
          <option value="Family office">Family office</option>
          <option value="Private bank">Private bank</option>
          <option value="Investment advisor">Investment advisor</option>
          <option value="Pension fund">Pension fund</option>
          <option value="Endowment">Endowment</option>
          <option value="Other">Other</option>
          </select>

          <script type="text/javascript">loadSelected();</script>
            • 26931
            • 2,314 Posts
            thanks coco_75
              • 5578
              • 15 Posts
              you welcome smiley,

              I think there is more simple but...

              i’ve just posted an other question in this forum, for underline in red missing fields, can you help me ?

              bye
                • 1778
                • 659 Posts