BullGuard Antivirus Sale - 60% Off with openElement !
openElement Website Homepage
Forum Home Forum Home >

openElement

> openElement General Discussion
  New Posts New Posts RSS Feed - how script
  FAQ FAQ  Forum Search   Register Register  Login Login

how script

 Post Reply Post Reply
Author
Message
fkhattab View Drop Down
Senior Member
Senior Member
Avatar

Joined: Jul 26 2016
Location: Cairo Egypt
Status: Offline
Points: 310
Post Options Post Options   Thanks (0) Thanks(0)   Quote fkhattab Quote  Post ReplyReply Direct Link To This Post Topic: how script
    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
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group
Avatar

Joined: May 31 2012
Status: Offline
Points: 4647
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Mar 20 2017 at 10:30pm
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.
Back to Top
fkhattab View Drop Down
Senior Member
Senior Member
Avatar

Joined: Jul 26 2016
Location: Cairo Egypt
Status: Offline
Points: 310
Post Options Post Options   Thanks (0) Thanks(0)   Quote fkhattab Quote  Post ReplyReply Direct Link To This Post Posted: Mar 21 2017 at 6:52am
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
Back to Top
fkhattab View Drop Down
Senior Member
Senior Member
Avatar

Joined: Jul 26 2016
Location: Cairo Egypt
Status: Offline
Points: 310
Post Options Post Options   Thanks (0) Thanks(0)   Quote fkhattab Quote  Post ReplyReply Direct Link To This Post Posted: Mar 21 2017 at 7:09am
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
Back to Top
Dmit OE View Drop Down
Admin Group
Admin Group
Avatar

Joined: May 31 2012
Status: Offline
Points: 4647
Post Options Post Options   Thanks (0) Thanks(0)   Quote Dmit OE Quote  Post ReplyReply Direct Link To This Post Posted: Mar 21 2017 at 10:49am
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.
Back to Top
fkhattab View Drop Down
Senior Member
Senior Member
Avatar

Joined: Jul 26 2016
Location: Cairo Egypt
Status: Offline
Points: 310
Post Options Post Options   Thanks (0) Thanks(0)   Quote fkhattab Quote  Post ReplyReply Direct Link To This Post Posted: Mar 21 2017 at 12:41pm
probably saving is the issue 

will try again 

thank you
Farid Khattab painter healer
Energy Oil Paintings
Back to Top
fkhattab View Drop Down
Senior Member
Senior Member
Avatar

Joined: Jul 26 2016
Location: Cairo Egypt
Status: Offline
Points: 310
Post Options Post Options   Thanks (0) Thanks(0)   Quote fkhattab Quote  Post ReplyReply Direct Link To This Post Posted: Mar 22 2017 at 6:04pm
I tried it and it works great
the saving was the issue

thank you as always
Farid Khattab painter healer
Energy Oil Paintings
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 10.11
Copyright ©2001-2012 Web Wiz Ltd.

This page was generated in 0,016 seconds.