hi, i have a combo box & 2 text box on my form for example: <form id="form1" name="form1" method="post" action=""> <select name="payment_mode" id="payment_mode"> <option value="cash">Cash</option> <option value="cheque">Cheque</option> <option value="credit card">Credit Card</option> </select> <input type="text" name="cheque no." id="cheque no." /> <input type="text" name="bank_name" id="bank_name" /> Now I want to hide those text box when the selected value from combo is cash. It works with the submit button but i dnt want to use submit button. How to i determine the selected value of list without submission of form.
<form id="form1" name="form1" method="post" action=""> <select name="payment_mode" id="payment_mode" onchange="hide_for_cash(this.value);"> <option value="cash">Cash</option> <option value="cheque">Cheque</option> <option value="credit card">Credit Card</option> </select> <div id="div_textbox"> <input type="text" name="cheque no." id="cheque no." /> <input type="text" name="bank_name" id="bank_name" /> </div> <javascript> function hide_for_cash(value){ if(value=='cash'){ docuement.getElementById('div_textbox').style.display="none"; }else{ docuement.getElementById('div_textbox').style.display="inline"; } } </javascript>