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 Link to comment https://forums.phpfreaks.com/topic/87202-solved-form-validation/ 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> Link to comment https://forums.phpfreaks.com/topic/87202-solved-form-validation/#findComment-446028 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") Link to comment https://forums.phpfreaks.com/topic/87202-solved-form-validation/#findComment-446032 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.