[Skip to main content](#vessel-content)

#   Populating a custom field drop down via jQuery....

##

- **[TheEdge](/forum/user/1997-theedge "View TheEdge's Profile")**
- [![TheEdge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1997.gif)](/forum/user/1997-theedge "View TheEdge's Profile") Topic Author
- [ Offline](/forum/user/1997-theedge)

Less More

- Posts: 62
- Thank you received: 0
-
-

12 years 3 months ago [\#168428](#168428) by [TheEdge](/forum/user/1997-theedge "View TheEdge's Profile")  *[Populating a custom field drop down via jQuery....](/forum/27-checkout/870530-populating-a-custom-field-drop-down-via-jquery#168428 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.3  Hi,  I have defined a custom field as a drop down that I want to populate via jQuery. The jQuery code finds the select control but I cannot seem to get the drop down to populate. As it looks like there is some special handling of the drop down introduced by HikaShop perhaps I need to do a refresh or something silimair? Attached is the HTML generated by the component and my jQuery code to attempt to populate it.  Can someone please show me how to populate the drop down?")* was created by *[TheEdge](/forum/user/1997-theedge "View TheEdge's Profile")*

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3.3

Hi,

I have defined a custom field as a drop down that I want to populate via jQuery. The jQuery code finds the select control but I cannot seem to get the drop down to populate. As it looks like there is some special handling of the drop down introduced by HikaShop perhaps I need to do a refresh or something silimair? Attached is the HTML generated by the component and my jQuery code to attempt to populate it.

Can someone please show me how to populate the drop down?

- [ ![html.png](/forum/attachment/19149) ](/forum/attachment/19149 "html.png") [ ](/forum/attachment/19149?download=1 "html.png")
- [ ![jQuery.png](/forum/attachment/19150) ](/forum/attachment/19150 "jQuery.png") [ ](/forum/attachment/19150?download=1 "jQuery.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MDUzMC1wb3B1bGF0aW5nLWEtY3VzdG9tLWZpZWxkLWRyb3AtZG93bi12aWEtanF1ZXJ5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

12 years 3 months ago [\#168454](#168454) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Populating a custom field drop down via jQuery....](/forum/27-checkout/870530-populating-a-custom-field-drop-down-via-jquery#168454 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.3  Hi,  I have defined a custom field as a drop down that I want to populate via jQuery. The jQuery code finds the select control but I cannot seem to get the drop down to populate. As it looks like there is some special handling of the drop down introduced by HikaShop perhaps I need to do a refresh or something silimair? Attached is the HTML generated by the component and my jQuery code to attempt to populate it.  Can someone please show me how to populate the drop down?")*

Hi,

This kind of dropdowns are introduced by Joomla.
I guess that you will have to remove the generated div with the id "deliverydate_chzn" and then do a ".chosen()" on your select in order to regenerate the new dropdown with the desired values.

Something like: Code:

jQuery('#deliverydate_chzn').remove(); jQuery('#deliverydate').removeClass('chzn-done').chosen();

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MDUzMC1wb3B1bGF0aW5nLWEtY3VzdG9tLWZpZWxkLWRyb3AtZG93bi12aWEtanF1ZXJ5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[TheEdge](/forum/user/1997-theedge "View TheEdge's Profile")**
- [![TheEdge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar1997.gif)](/forum/user/1997-theedge "View TheEdge's Profile") Topic Author
- [ Offline](/forum/user/1997-theedge)

Less More

- Posts: 62
- Thank you received: 0
-
-

12 years 3 months ago [\#169158](#169158) by [TheEdge](/forum/user/1997-theedge "View TheEdge's Profile")  Replied by *[TheEdge](/forum/user/1997-theedge "View TheEdge's Profile")* on topic *[Populating a custom field drop down via jQuery....](/forum/27-checkout/870530-populating-a-custom-field-drop-down-via-jquery#169158 "-- HikaShop version -- : 2.3.2 -- Joomla version -- : 3.3.3  Hi,  I have defined a custom field as a drop down that I want to populate via jQuery. The jQuery code finds the select control but I cannot seem to get the drop down to populate. As it looks like there is some special handling of the drop down introduced by HikaShop perhaps I need to do a refresh or something silimair? Attached is the HTML generated by the component and my jQuery code to attempt to populate it.  Can someone please show me how to populate the drop down?")*

> Xavier wrote: Hi,
>
> This kind of dropdowns are introduced by Joomla.
> I guess that you will have to remove the generated div with the id "deliverydate\_chzn" and then do a ".chosen()" on your select in order to regenerate the new dropdown with the desired values.
>
> Something like:
>
> Code:
>
> jQuery('#deliverydate_chzn').remove(); jQuery('#deliverydate').removeClass('chzn-done').chosen();

That put me on the right path. After doing the population all that you need to do is:

Pre Chosen 1.0: $('.chzn-select').trigger("liszt:updated");
Chosen 1.0 $('.chosen-select').trigger("chosen:updated");

And in my case I had to use Pre Chosen 1.0

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg3MDUzMC1wb3B1bGF0aW5nLWEtY3VzdG9tLWZpZWxkLWRyb3AtZG93bi12aWEtanF1ZXJ5P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.053 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
