Note that there are some explanatory texts on larger screens.

plurals
  1. POOnce I get a value from a dropdown menu can I compare it with a string?
    primarykey
    data
    text
    <p>All I've is this but i get no value from the dropdown menu for java script to compare it to a string</p> <pre><code> // JavaScript Document 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"){ document.getElementById("nextButton").setAttribute("data-location", "multiSet.html"); } else{ alert("notworking"); } </code></pre> <p>And the dropdown menu is this one: how do i get the value from the options of single or multi container?</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>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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