I asked for help earlier and got it working correct which i’m very thankfull for. But now I have wanted to make some more indepth.
My problem is that, I have a <li> which is used as a dropdown, which later opens a body where theres a select, and option value which I put a url value into.
But I rather have it look on which <li> I first pick, and then depending on which option value I use adds more value so I get a complete url.
Example:
<li> sets http://localhost/someplace/api/stop/
and the option value sets ~/api/stop/all?format=excel because I picked excel format as option.
Then I have a js with button which does
$(".get-data").on("click",function() {
var location = $('#dd-files').val();
if(location) {
window.open(location);
}
});
But how do I pass the <li> value and option value picks into this.
Thanks for any pointers!
You can add an onclick event to the list items and then use $(this) to get the text or to get the name or id or whatever you want.
http://jsfiddle.net/32ZEx/
Does this help you?