Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Since you're not passing any parameters into your <code>get_qpe()</code> function, those variables are being returned as <code>undefined</code>. Try this:</p> <p>Change your button to the following:</p> <pre><code>&lt;input type="submit" value="Get QPE Map" id="submit"&gt; </code></pre> <p>And then add the following JavaScript:</p> <pre><code>function listen(event, elem, func) { if (elem.addEventListener) elem.addEventListener(event, func, false); else if (elem.attachEvent) { var r = elem.attachEvent("on" + event, func); return r; } } listen('load', window, function() { var form = document.getElementById('SelectURL6'), btn = document.getElementById('submit'); function get_qpe(elems) { var url = '', o = {}, val = 0, names = [], thisElem; for (var i = 0; i &lt; elems.length; i += 1) { thisElem = elems[i]; names.push(thisElem.getAttribute('name')); val = thisElem.options[thisElem.selectedIndex].value; o[names[i]] = parseInt(val); } o.TE = o.TE + 7; if (o.ME === 12 &amp;&amp; o.DE === 31 &amp;&amp; o.TE &gt; 24) { o.YE = o.YE + 1; o.ME = 1; o.DE = 1; o.TE = o.TE - 24; } else if (o.DE === 31 &amp;&amp; o.TE &gt; 24) { o.ME = o.ME + 1; o.DE = 1; o.TE = o.TE - 24; } else if (o.DE === 30 &amp;&amp; o.ME === 4 &amp;&amp; o.TE === 24) { o.ME = o.ME + 1; o.DE = 1; o.TE = o.TE - 24; } else if (o.DE === 30 &amp;&amp; o.ME === 6 &amp;&amp; o.TE === 24) { o.ME = o.ME + 1; o.DE = 1; o.TE = o.TE - 24; } else if (o.DE === 30 &amp;&amp; o.ME === 9 &amp;&amp; o.TE === 24) { o.ME = o.ME + 1; o.DE = 1; o.TE = o.TE - 24; } else if (o.DE === 30 &amp;&amp; o.ME === 12 &amp;&amp; o.TE === 24) { o.ME = o.ME + 1; o.DE = 1; o.TE = o.TE - 24; } else if (o.TE &gt; 24) { o.TE = o.TE - 24; o.DE = o.DE + 1; } url = "http://nmq.ou.edu/cgi-bin/tools_QPE.cgi?1+0+2+" + o.YE + "+" + o.ME + "+" + o.DE + "+" + o.TE + "+0+0+34.50+-114.00+32.50+800+632+4101+0+0+1+0+Q2RAD_HSR+Q2RAD_HSR_GC+" + o.TS + "+english+none+CNTY"; window.open(url); } listen('click', btn, function() { var selectElems = form.getElementsByTagName('select'), i = 0; get_qpe(selectElems); }); }); </code></pre> <p>Here is a <a href="http://jsfiddle.net/9dM4Q/7/" rel="nofollow">jsFiddle</a> that you can reference.</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