Note that there are some explanatory texts on larger screens.

plurals
  1. POJS changed in aspx from html
    text
    copied!<p>sorry I normally work through things like this (work related projects) on my own but do to circumstances I can't control I'm pretty much out of time, and ideas. I don't normally work in web scripting languages (i am learning c++ but I have had lots of html experience in the past so my boss put me on the job) but I managed to get some code made up to jump to a url based on 3 combo boxes input using javascript in html. I did not realize aspx though dose not handle js the same way that html does, until I completed the small project and put it in my aspx page. Here's the problem it seems to be small, but the go() function is no longer working correctly. I tested it by putting an alert box in the go() function and it seems the go function is still being called because the alert box showed on the button click, but I can't seem to get it to jump the the value in the third combo box. Does anybody know a quick fix that will work to change the url in aspx or any suggestions about other methods of completing this task? Any help is greatly appreciated, and thank you for your time.</p> <pre><code>&lt;script language="JavaScript" type="text/javascript"&gt; // first combo box data_1 = new Option("Acura", "$"); // second combo box data_1_1 = new Option("MDX", "-"); // third combo box data_1_1_1 = new Option("2007", "http://www.DawnEnterprises.co/2007-Acura-MDX-Accessories.aspx"); displaywhenempty="" valuewhenempty=-1 displaywhennotempty="-select-" valuewhennotempty=0 function change(currentbox) { numb = currentbox.id.split("_"); currentbox = numb[1]; i=parseInt(currentbox)+1 while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) &amp;&amp; (document.getElementById("combo_"+i)!=null)) { son = document.getElementById("combo_"+i); for (m=son.options.length-1;m&gt;0;m--) son.options[m]=null; son.options[0]=new Option(displaywhenempty,valuewhenempty) i=i+1 } stringa='data' i=0 while ((eval("typeof(document.getElementById(\"combo_"+i+"\"))!='undefined'")) &amp;&amp; (document.getElementById("combo_"+i)!=null)) { eval("stringa=stringa+'_'+document.getElementById(\"combo_"+i+"\").selectedIndex") if (i==currentbox) break; i=i+1 } following=parseInt(currentbox)+1 if ((eval("typeof(document.getElementById(\"combo_"+following+"\"))!='undefined'")) &amp;&amp; (document.getElementById("combo_"+following)!=null)) { son = document.getElementById("combo_"+following); stringa=stringa+"_" i=0 while ((eval("typeof("+stringa+i+")!='undefined'")) || (i==0)) { if ((i==0) &amp;&amp; eval("typeof("+stringa+"0)=='undefined'")) if (eval("typeof("+stringa+"1)=='undefined'")) eval("son.options[0]=new Option(displaywhenempty,valuewhenempty)") else eval("son.options[0]=new Option(displaywhennotempty,valuewhennotempty)") else eval("son.options["+i+"]=new Option("+stringa+i+".text,"+stringa+i+".value)") i=i+1 } //son.focus() i=1 combostatus='' cstatus=stringa.split("_") while (cstatus[i]!=null) { combostatus=combostatus+cstatus[i] i=i+1 } return combostatus; } } function go(the_value) { location = document.MMYSearch.combo2. options[document.MMYSearch.combo2.selectedIndex].value } &lt;/script&gt; &lt;form id="MMYSearch" action="../../../js/MMYSearch.js" name="MMYSearch"&gt; &lt;h4&gt;Vehicle &lt;span class="selection"&gt;Selection&lt;/span&gt;&lt;/h4&gt; &lt;p&gt;Select the Make of your vehicle:&lt;/p&gt; &lt;select name="combo0" id="combo_0" onchange="change(this);" style="width:230px;"&gt; &lt;option value="value1"&gt;-select-&lt;/option&gt; &lt;option value="value2"&gt;Acura&lt;/option&gt; &lt;/select&gt; &lt;p&gt;Select the Model of your vehicle:&lt;/p&gt; &lt;select name="combo2" id="combo_1" onchange="change(this);" style="width:230px;"&gt; &lt;/select&gt; &lt;p&gt;Select the Year of your vehicle:&lt;/p&gt; &lt;select name="combo2" id="combo_2" onchange="change(this);" style="width:230px;"&gt; &lt;/select&gt; &lt;div&gt; &lt;input type="button" name="Select" value="Select" onclick="go()" /&gt; &lt;/div&gt; &lt;/form&gt; </code></pre>
 

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