Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to set a link to a button depending on the desition taken?
    text
    copied!<p>All i want is that if the user decide to have a multiple set value, then the "next" button get a different link to a different page .</p> <pre><code> var singleMulticontainer = document.getElementById("singleMultiContainer"); var singleMultiValue = singleMultiContainer.options[singleMultiContainer.selectedIndex].value; var nextButton = document.getElementById("nextButton"); var multipleSetWindow = "window.location='multiSet.html'" if(singleMultiValue == "multi"){ nextButton.onclick = multipleSetWindow; } else{ alert("notworking"); } </code></pre> <p>The HTML fragment:</p> <pre><code>&lt;form id"suspendedProperties"&gt; &lt;p&gt;&lt;h4&gt;Select Station: &lt;select name="stationDropdown"&gt; &lt;option value="50028000"&gt;Tanama&lt;/option&gt; &lt;option value="60008001"&gt;Example Riv1&lt;/option&gt; &lt;option value="60008002"&gt;Example Riv2&lt;/option&gt; &lt;option value="60008003"&gt;Example Riv3&lt;/option&gt; &lt;option value="60008004"&gt;Example Riv4&lt;/option&gt; &lt;/select&gt; &lt;/h4&gt;&lt;/p&gt; &lt;p&gt;Select Sample Medium: &lt;select name="sampleMediumDropdown"&gt; &lt;option value="Wer"&gt;Wer&lt;/option&gt; &lt;option value="WSQ"&gt;WSQ&lt;/option&gt; &lt;/select&gt; &lt;/p&gt; &lt;p&gt;Begin Date &lt;input type="date"/&gt; &lt;/p&gt; &lt;p&gt;Hydrologic Event: &lt;select name="hydroEvent"&gt; &lt;option value="1"&gt;Example 1&lt;/option&gt; &lt;option value="2"&gt;Example 2&lt;/option&gt; &lt;option value="3"&gt;Example 3&lt;/option&gt; &lt;option value="4"&gt;Example 4&lt;/option&gt; &lt;option value="5"&gt;Example 5&lt;/option&gt; &lt;option value="6"&gt;Example 6&lt;/option&gt; &lt;/select&gt; &lt;/p&gt; &lt;p&gt;Add:&lt;input type="number" size=""/&gt; &lt;select name="singleMultiContainer"&gt;&lt;option value="single"&gt;Single container sample&lt;/option&gt;&lt;option value="multi"&gt;Multiple sets container&lt;/option&gt;&lt;/select&gt;&lt;/p&gt; &lt;p&gt;Analyses Requested:(Applies to all samples)&lt;br/&gt;&lt;/p&gt; &lt;div id="analyses" &gt; &lt;input type="checkbox" name="analysis" value="C"&gt;Concentration&lt;/input&gt; &lt;input type="checkbox" name="analysis" value="SF"&gt;Sand-fine break**&lt;/input&gt;&amp;nbsp; &lt;input type="checkbox" name="analysis" value="SA"&gt;Sand analysis**&lt;/input&gt; &lt;br/&gt; &lt;input type="checkbox" name="analysis" value="T"&gt;Turbidity&lt;/input&gt; &lt;input type="checkbox" name="analysis" value="LOI"&gt;Loss-on-ignition**&lt;/input&gt;&amp;nbsp; &lt;input type="checkbox" name="analysis" value="DS"&gt;Dissolve solids&lt;/input&gt; &lt;br/&gt; &lt;input type="checkbox" name="analysis" value="SC"&gt;Specific conductance&lt;/input&gt; &lt;input type="checkbox" name="analysis" value="Z"&gt;Full-size fractions**&lt;/input&gt; &lt;/div&gt; &lt;input type="button" value="Back" onClick="window.location='SED_WE.html'"/&gt; &lt;input type="button" value="Next" onClick="window.location='SampleInfo.html'"/&gt; &lt;/form&gt; </code></pre> <p>So the last 2 lines are the next and the back buttons. I want to give the next Button the multiSet.html value if the user choose to have multiple sets container.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload