How do I handle error checking based only on Items displayed
<p>Greetings again helpers,</p>

<p>I have these snips:</p>

<pre><code>&lt;head&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;
&lt;!-- Begin
function validate() {
missinginfo = "";
if (document.form.catdescription.value == "0") {
missinginfo += "\n     -  Category CANNOT be blank";
}
if (document.form.pcode.value == "")  {
missinginfo += "\n     -  Product Code CANNOT be blank";
}
if (document.form.pname.value == "") {
missinginfo += "\n     -  Product Name CANNOT be blank";
}
if (document.form.pdescription.value == "") {
missinginfo += "\n     -  Product Description CANNOT be blank";
}
if (( form.IsSpecial[0].checked == false ) &amp;&amp; ( form.IsSpecial[1].checked == false )) {
missinginfo += "\n     -  please check Yes or No";
}
if ((document.form.pphoto.value == "") || (document.form.pphoto.value == "NA"))
 {
missinginfo += "\n     -  Photo is either blank or does not contain NA";
}
if (document.form.unitprice.value == "") {
missinginfo += "\n     -  Price is NOT blank";
}
if (document.form.file2.value == "") {
missinginfo += "\n     -  Browse a picture to upload";
}

if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"Please ensure that:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else return true;
}
//  End --&gt;
&lt;/script&gt;
&lt;script type="text/JavaScript"&gt;
&lt;!-- Begin
function ChangeDiv(id)
{
if(id == "No")
{
document.getElementById('nof').style.display = "block";
document.getElementById('yesf').style.display = "none";
}
else
{
document.getElementById('nof').style.display = "none";
document.getElementById('yesf').style.display = "block";
}
}
//  End --&gt;
&lt;/script&gt;
&lt;/head&gt;
   &lt;TABLE BORDER=0 CELLSPACING=0 CELLPADDING=4 BORDERCOLOR="YELLOW" &gt;
    &lt;tr&gt;
    &lt;td class="body1" div align="right"&gt;
       &lt;div id="yesf" style="display:none;"&gt;
       Promo Start Date:
      &lt;input type="text" name="pstartdate" class="normaltxt"&gt;&lt;br&gt;
       Promo End Date:
      &lt;input type="text" name="penddate" class="normaltxt"&gt;&lt;br&gt;
       PROMO Price:
      &lt;input type="text" name="txtsprice" value=""&gt;
      &lt;/div&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
     &lt;td class="body1" div align="right"&gt;
     &lt;div id="nof"&gt;
      Regular Price:
      &lt;input type="text" name="unitprice" value=""&gt;
        &lt;/div&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
</code></pre>

<p>These are relevant code.</p>

<p>If the user clicks on the Yes radio button, all form fields inside the -->  are displayed. If the user checks the No radio button the only form field called price is displayed for data entry.</p>

<p>So far so good. The issue I am struggling with is how to make sure the Javascript validation code I posted above only raises an alert for only visible form fields.</p>
