Making ASP label visible in Javascript?
<p>This is my label I want to display if the user have left out field before clicking the button. What am I doing wrong because nothing is happening when I click the button.</p>

<pre><code>&lt;asp:Label ID="lblError" runat="server" 
Text="* Please complete all mandatory fields" style="display: none;" &gt;
&lt;/asp:Label&gt;
</code></pre>

<p>This is the function I call when I click on the button:</p>

<pre><code>function valSubmit(){
    varName = document.form1.txtName.value;
    varSurname = document.form1.txtSurname.value;

    if (varName == "" || varSurname == "") 
    {
     document.getElementById('lblError').style.display = 'inherit'; 

    }
    else
    { 

     .................other code go here...........................
    return true; 
    } 
</code></pre>

<p>}</p>
