August 3, 201610 yr Hello, I'm having a problem with this code I created. As you can see in the JSFiddle I post below you can click the Region button and click a region. The main text changes then. But when you click on the background a couple of times, the button just becomes blank and it shows no text. How would I go about keeping the current text I selected in there untill I change to another region. The second question is. I've tried multiple things to get the button on the right side in the search box. So it's not underneath there, but it's not working. https://jsfiddle.net/03ba1u5m/ Thanks in advance BPrepper
August 3, 201610 yr It's not working at all for me. Why all the jQuery? All you really need is a combobox. This is just one example of many: http://stackoverflow.com/questions/14614702/html-combo-box-with-option-to-type-an-entry
August 3, 201610 yr Author It's not working at all for me. Why all the jQuery? All you really need is a combobox. This is just one example of many: http://stackoverflow.com/questions/14614702/html-combo-box-with-option-to-type-an-entry I fixed the button not displaying any text. This is the new Javascript for it: $(document).ready(function(){ var regionDropDown = $('.region_dropdown_section'), regionButton = regionDropDown.find('button'), regionList = regionDropDown.find('.region_dropdown_content').children(); $(regionList).on('click', function(e){ var region = e.target; regionButton.text(region.text).val(region.text); }); }); The only problem I still got now is to put the button on the right side inside the search bar, or on the right side of the search bar but against it. Edited August 3, 201610 yr by BPrepper
August 3, 201610 yr Author Fixed most issues, Only issues I got now is the white space on the right side of the button that I can't seem to be fixing. Also when zooming in the page, the button goes underneath the searchbar. Is it possible to have that button be the same size as the searchbar then? JsFiddle: https://jsfiddle.net/tgcrLo67/ Example: http://www.broadcasteralerts.com/ Hopefully anybody can help me!
Create an account or sign in to comment