adam291086 Posted January 22, 2008 Share Posted January 22, 2008 I need a tutorial or example code to help me hide form feilds. For example If question 1 == No then keep question Two hidden. If question 2 ==Yes then show question two. Thanks for the help Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted January 22, 2008 Share Posted January 22, 2008 <script language="javascript"> function checker(val) { if (val == "Yes") { document.getElementById('negative').checked = false; document.getElementById('question2').style.display='block'; } else if (val == "No") { document.getElementById('positive').checked = false; document.getElementById('question2').style.display='none'; } } </script> Is this the first question you have ever answered?<br><br> <input type="radio" onclick="checker(this.value)" id="positive" value="Yes">Yes <input type="radio" onclick="checker(this.value)" id="negative" value="No">No <br><br> <span id="question2" style="display:none"> Add your second question here......... </span> Quote Link to comment Share on other sites More sharing options...
adam291086 Posted January 22, 2008 Author Share Posted January 22, 2008 as i am new two java would this work if (val == "Seller" || val == "buyer") Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.