Note that there are some explanatory texts on larger screens.

plurals
  1. POIf function in drop down list using JavaScript
    primarykey
    data
    text
    <p>I am trying to make an expert system to detect network problems. The user will have 4 question each with 3 to 4 answers. After the input from the user, the user will click the button and it will detect and solve the problem. I kinda got the idea, but i know few things are missing. At the moment, I only added some 2 random questions and answers, to check if is actually working. Please help with java script, so it will give details on the network problem depending on the answers. Thanks in advance! :)</p> <pre><code> 1.Can you access to the internet? &lt;BR&gt; &lt;select id="internet"&gt; &lt;option value="yes"&gt;yes&lt;/option&gt; &lt;option value="No"&gt;no&lt;/option&gt; &lt;option value="Yes, but at slow"&gt;Yes, but at slow&lt;/option&gt; &lt;option value="Yes/No, it workes but it suddenly it stops and start working again "&gt;Yes/No, it workes but it suddenly it stops and start working again&lt;/option&gt; &lt;/select&gt; &lt;br&gt; &lt;br&gt;&lt;p&gt; 2.Is it just your computer?&lt;BR&gt; &lt;select id="computer"&gt; &lt;option value="yes"&gt;yes&lt;/option&gt; &lt;option value="whole company"&gt;whole company&lt;/option&gt; &lt;option value="just my department"&gt;just my department&lt;/option&gt; &lt;option value="me and few staff"&gt;me and few staff&lt;/option&gt; &lt;/select&gt; &lt;br&gt; &lt;br&gt;&lt;p&gt; &lt;button onclick="myFunction()"&gt;Detect&lt;/button&gt; &lt;p id="Solution"&gt;&lt;/p&gt; &lt;script&gt; function myFunction() { if (internet=="no"||computer=="yes")   {   x="check your cable is not cut or loose";   } else if (internet=="no"||computer=="yes")   {   x="connection problem";   } else   {   x="other problems....";   } document.getElementById("Solution").innerHTML=x; } &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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