Start a new topic

Creating a Dropdown List for Quantity

I’m trying to us a drop down list for the qty in QuoteValet, so I can restrict the client to a set of specific quantities.

 

Looking at the resultant html when using a textbox, it uses a name of DI_QtyBase___n, where n is the line number starting from 0.

 

So my plan is to use Javascript to create the appropriate HTML, but in the first instance, I’m just trying to get it to work with some hardcoded html.

 

So I have the following code to create a dropdown list for the first line on the quote.

 

  <select name="DI_QtyBase___0" id="DI_QtyBase___0" type="number">

  <option selected="selected">[DI_QtyBase]</option>

  <option value="1">1</option>

  <option value="2">2</option>

  <option value="3">3</option>

  <option value="4">4</option>

  </select>

 

What’s happening is that is appending the selected value to the existing value.

 

What’s even more strange, is if I have more than one product, ie I have 3 products with qty’s of 1, 1 & 2, and have the select box on the first product, and change the 1 to a 3 I get 1312.


Anyone have any ideas?


Hi John

 

You can use the "InputType=DropDownList" macro attribute to accomplish this.

 

In your example I believe the following should do it for you:

[DI_QtyBase:InputType=DropDownList,ListItems=1;2;3;4] 




MIke,

Thanks, I'll give that a try

Mike,


this doesn't work. See screenshot.


It just displays the text of the macro, and doesn't convert it. However it does convert the values make up the list.


 

                    <td class="col-qty" update-qty="[DI_CustomText20]">
                        <!-- Display Qty in textbox when CustomText20 is flagged as Y, and as DropDownList when CustomText20 is D.
                                CustomText17 has the quantity list separated by ";", ie "1;2;3;4"-->
                        <span>[DI_QtyBase]</span>
                        <div class="col-qty" update-qty="[DI_CustomText20]">
                        [DI_QtyBase:InputType=TextBox,size="2"]
                        </div>
                        <div class="dd-qty" update-qty="[DI_CustomText20]">
                        [DI_QtyBase:InputType=DropDownList,ListItems=[DI_CustomText17]]
                        </div>
                    </td>

 

I worked out it will work if I hard code the value of the list items... 

                        <div class="dd-qty" update-qty="[DI_CustomText20]">
                        [DI_QtyBase:InputType=DropDownList,ListItems=2;3;4]
                        </div>

 This is not very useful. Any ideas on getting this to work from the data?

Just to let anyone know who finds this thread, I've got this to work, and I sell my QV templates as a product if you are interested.

Login or Signup to post a comment