how script |
Post Reply |
Author | |
fkhattab
Senior Member Joined: Jul 26 2016 Location: Cairo Egypt Status: Offline Points: 310 |
Post Options
Thanks(0)
Posted: Mar 20 2017 at 7:32pm |
I tried to make this work
<select name="menu1" id="menu1"> <option value="http://www.espn.com">ESPN</option> <option value="http://www.cnn.com">CNN</option> <option value="http://www.abcnews.com">ABC</option> <option value="http://www.cbsnews.com">CBS</option> <option value="http://www.foxnews.com">FOX</option> </select> <script type="text/javascript"> var urlmenu = document.getElementById( 'menu1' ); urlmenu.onchange = function() { window.open( this.options[ this.selectedIndex ].value ); }; </script> I placed in the body it works as a combo box but doesn't open the link I am trying to have a combo box with jump to links any suggestions
|
|
Farid Khattab painter healer
Energy Oil Paintings |
|
Dmit OE
Admin Group Joined: May 31 2012 Status: Offline Points: 5283 |
Post Options
Thanks(0)
|
Hi,
What is the type of the Block? It shoudl be either Visual (I suppose it is), or Source type HTML. Please publish online and give the link. Maybe you have another error somewhere in another Block that breaks all Javascript execution including this script. |
|
fkhattab
Senior Member Joined: Jul 26 2016 Location: Cairo Egypt Status: Offline Points: 310 |
Post Options
Thanks(0)
|
I tried visual it doesn't show on preview
I tried source it doesn't show on preview in source I put in type html and position startbody however if I put the same code in block and also in visual then 2 instances show in preview then I delete the visual and in preview it shows one instance , but position is at top left of the window and I have no control over position I am experimenting with it till I figure out how to make it work I also use a new page for my experiments thank you
|
|
Farid Khattab painter healer
Energy Oil Paintings |
|
fkhattab
Senior Member Joined: Jul 26 2016 Location: Cairo Egypt Status: Offline Points: 310 |
Post Options
Thanks(0)
|
I put 1st visual doesn't show in preview
then I put source also doesn't show in preview then then I put source 1st then visual 2nd and in preview 2 instances show then I delete source and keep visual then only one instance show and I can control the position as it is visual Of course I don't why this happens but it works this way Thank you for your help
|
|
Farid Khattab painter healer
Energy Oil Paintings |
|
Dmit OE
Admin Group Joined: May 31 2012 Status: Offline Points: 5283 |
Post Options
Thanks(0)
|
You should always save the page to see the Blocks applied in preview. I've used your code as is to put into a Code Block Visual and it shows fine in preview, and opens pages on selection. If it does not work the problem is outside of this script.
|
|
fkhattab
Senior Member Joined: Jul 26 2016 Location: Cairo Egypt Status: Offline Points: 310 |
Post Options
Thanks(0)
|
probably saving is the issue
will try again thank you
|
|
Farid Khattab painter healer
Energy Oil Paintings |
|
fkhattab
Senior Member Joined: Jul 26 2016 Location: Cairo Egypt Status: Offline Points: 310 |
Post Options
Thanks(0)
|
I tried it and it works great
the saving was the issue thank you as always
|
|
Farid Khattab painter healer
Energy Oil Paintings |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |