Linking from within a form element (please help)

(ronnie_leyland) #1

I would like to make a drop down list from within a form (option) that is linkable to my scene.

THIS WORKS for normal web links - however I want to link:

<form name="jump">
<select name="menu">
<option value="#">List --></option>
<option value="">Macrumors</option>
<option value="">Apple</option>
<input type="button" onClick="[].value;" value="GO">

however I want to link to my scene pages in hype - can’t figure this out:-(

<form name="jump">
<select name="menu">
<option value="#">List --></option>
<option value="WHAT CODE GOES HERE?">Dogs</option>
<option value="WHAT CODE GOES HERE?">Cats</option>
<option value="WHAT CODE GOES HERE?">Birds</option>
<input type="button" onClick="[].value;" value="GO">

My scene names(pages)

I got it to work in a menu using this code… but I like to do this in a from linking to my scenes.

Putting this in my header


  function myCallback(hypeDocument, element, event) {
    window.myhypedocument = hypeDocument;
  if("HYPE_eventListeners" in window === false) {
    window.HYPE_eventListeners = Array();
  window.HYPE_eventListeners.push({"type":"HypeDocumentLoad", "callback":myCallback});


This works this way

<div class="scrollmenu"> 
  <a href="#" onclick="window.myhypedocument.showSceneNamed('Dog');">Dog</a>
  <a href="#" onclick="window.myhypedocument.showSceneNamed('Cat');">Cat</a>

But I want to do this via a form with the <options>.

(Mark Hunte) #2

You are half way there…

<form name="jump">
<select name="menu">
<option value="#">List --&gt;</option>
<option value="Dogs">Dogs</option>
<option value="Cats">Cats</option>
<option value="Birds">Birds</option>
<input type="button" onclick="window.myhypedocument.showSceneNamed([].value);" value="GO">
</form> (44.7 KB)

(Hans-Gerd Claßen) #3

you may even skip the submit-button by listening for onchange of the menu-element (run it on sceneload)…

menu.onchange =  function(e){