Displaying array values on page
<pre><code>var msg = new Array(); 

msg [0] = 'Credit Card number is invalid';
msg [1] = 'Card holders name is required';
</code></pre>

<p>id like the relevant message to come up when my form is submitted. Form example:</p>

<pre><code>&lt;form id="PaymentForm" name="PaymentForm" method="post" action="#" class="big_box background border_solid"&gt;

  &lt;input type="text" name="CardNumber" id="CardNumber" size="25" maxlength="25" /&gt;
  &lt;span id="CardNumberMessage" style="display:none;color:red"&gt;&lt;xsl:text&gt; &lt;/xsl:text&gt;*&lt;/span&gt;

  &lt;div id="FieldsRequired"&gt;&lt;/div&gt;

  &lt;input name="submitbutton" id="submitbutton" type="submit" /&gt;    

&lt;/form&gt;
</code></pre>

<p>so when the first field, in this case CardNumber is incorrect an * is placed next to the field and a message comes up next to the submit in the FieldsRequired div is saying whats in the Array msg[0]. I have two functions that show or hide the spans.</p>

<pre><code> function showStuff(id,msg) {
document.getElementById(id).style.display = '';
document.getElementById(FieldsRequired).value;&lt;!--this part might be wrong--&gt;

 };

 function hideStuff(id,msg) {
document.getElementById(id).style.display = 'none';
document.getElementById(FieldsRequired).value;
 };
</code></pre>

<p>any help would be great.</p>
