Hi, I don't understand why it didn't release the output whereas I took this coding from my lecture
However, when I change 'selectedIndex' to 'value,' it simply provides the output. Your assistance is greatly appreciated by a newbie like me. :) <html> <head> <title>Menu Validation</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script> function validate() { let price = document.forms["taxForm"]["price"].selectedIndex; if (price === 0) { alert ("Please select your Price."); return false; } let state = document.forms["taxForm"]["state"].selectedIndex; if (state === 0) { alert ("Please select your State."); return false; } return true; } </script> </head> <form name="taxform" method="GET" action=""> <select name="price"> <option>Choose Price</option> <option value="15000">15000</option> <option value="20000">20000</option> <option value="25000">25000</option> <option value="30000">30000</option> <option value="45000">45000</option> </select> <br><br> <select name="state"> <option>Choose State</option> <option value="0.029">Terengganu 2.9%</option> <option value="0.0625">Pahang 6.25%</option> <option value="0.04">Selangor 4%</option> <option value="0.07">Terengganu 7%</option> </select> <br><br> <input type="submit" value="Submit Form" onClick="return validate()"> </form> </html>