Option Select

Is there a way to navigate to a URL or Page based on the option selected in the option select item?

Hello,

set the url as value in the Option select. Then add an id to the option select e.g. navselect.

After that add the following code to the page settings.

2 Likes

Here also a video explaining it:

http://blocs-extensions.com/_help/videos/blocs2/select-nav/

1 Like

this code doesnt work for me :frowning: you can help me?

Hello @rafinhanz

Try the following:
Give the select option an id i.e #link.
Add the following code to the footer of your page:

<script>
$(document).ready(function() {
///////////////////////////////
$("#link").change(function(){ // change function of listbox
//alert($('#link').val());
window.location = $('#link').val();
});
//////////////////////////
})
</script>

And you should be good to go.
Short video you can download here. Kapture 2020-12-27 at 09.21.08.mp4.zip (745.2 KB)

Is it possible to define what selection option is active in Blocs …

… so it would end up looking like this in the exported code:

<select>
	<option value="1">1 Bottle</option>
	<option value="2">2 Bottles</option>
	<option value="3" selected="selected">3 Bottles</option>
</select>

Just add “selected” as a custom attribute to the option you wish to be selected.

1 Like

@Jerry Oh man, it’s so easy, sorry. :flushed: I’m a bit slow today, it seems.
Thanks Jerry.

Happy to help to my knowledge :grinning:

2 Likes