orbital 15 Posted July 28, 2012 Report Share Posted July 28, 2012 I am wanting to build conditional buttons based upon the selection of a dropdown. I used an if statement but that didn't work. I don't even know if this is possible but I thought I would try. ui window("Search Settings") { ui drop down("Chose Country", "US,UK", #country) if("{#country}=US") { then { ui button("US Ebay Category Numbers ") { navigate("http://listings.ebay.com/_W0QQfclZ1QQloctZShowCatIdsQQsocmdZListingCategoryList", "Wait") } } else { ui button("UK Ebay Category Numbers ") { navigate("http://listings.ebay.co.uk/_W0QQloctZShowCatIdsQQsacatZQ2d1QQsalocationZlicQQsocmdZListingCategoryList", "Wait") } } } ui text box("Top Level Ebay Category Number to be Searched. 0 is all categories", #categoryToSearch) } Quote Link to post Share on other sites
blumi40 222 Posted July 28, 2012 Report Share Posted July 28, 2012 if(#country = "US" OR #pla = "plupp" OR #one != 1) { then { } else if(#country = "DE" OR #one != 2) { } else { }} Quote Link to post Share on other sites
orbital 15 Posted July 28, 2012 Author Report Share Posted July 28, 2012 thanks for the feedback. I'm trying to make it so based upon a selection of the drop down a button shows up in the menu. So if they select US then the US button shows up and if they select UK then the UK button shows up for them to click on if they want. Quote Link to post Share on other sites
James J 3 Posted July 28, 2012 Report Share Posted July 28, 2012 What is going to happen after they click the US or UK button is it going to do a search?Or is it some option process that the end user should be able to choose whether they want to happenor not? A solution I have used for a need for a dynamic UI i.e. thing changing based upon user selectionis to us an if statement combined with the load html command. So if US is true then load the HTMLwith the US checkbox in the browser. If checked you can use that to trigger the commands that you want to run. Just remember you have to scrape the attribute of thecheck box to to trigger the commands. Something like IF---->SCRAPE ATRIBUTE---->CHECKED =$true. The only drawback is yo have to make a set of commands for each one of your original dropdown/selection items. James Quote Link to post Share on other sites
orbital 15 Posted July 28, 2012 Author Report Share Posted July 28, 2012 What is going to happen after they click the US or UK button is it going to do a search?Or is it some option process that the end user should be able to choose whether they want to happenor not? Thanks for the help on this James. If the user chooses UK then a button appears for them to click. When they click the button it navigates them to the UK ebay category listings page. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted July 28, 2012 Report Share Posted July 28, 2012 the way its shown from willywonka or blumi is correct. the way your wanting to do it you would need to use ui html panel or ui html window and use a combination of html and javascriptonclick and have it execute a defined command Quote Link to post Share on other sites
orbital 15 Posted July 28, 2012 Author Report Share Posted July 28, 2012 the way its shown from willywonka or blumi is correct. the way your wanting to do it you would need to use ui html panel or ui html window and use a combination of html and javascriptonclick and have it execute a defined command ok, thanks. I don't have dev so I don't have those available to me. I think I got something working now with the above suggestions. Quote Link to post Share on other sites
stan beck 0 Posted September 19, 2012 Report Share Posted September 19, 2012 the way its shown from willywonka or blumi is correct. the way your wanting to do it you would need to use ui html panel or ui html window and use a combination of html and javascriptonclick and have it execute a defined command Unclear... From Javascript, how does one execute uBot code? From uBot, how does one execute javascript? Thank you... Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.