js forms clearing after validate
<p>Hi i am wondering if there is any way of stopping my forms from clearing after I submit and the validation error comes up?</p>

<p>Just to clarify I have multiple forms, when user submits I am using js to validate, when the validation error alerts all the forms reset is there any way to stop that??? "yes it does have to be javascript"</p>

<pre><code>&lt;script&gt;
                                                                    //calender dropdown menu 

var monthtext=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sept','Oct','Nov','Dec'];

function populatedropdown(dayfield, monthfield, yearfield,init){
 var dayfield=document.getElementById(dayfield);
 var monthfield=document.getElementById(monthfield);
 var yearfield=document.getElementById(yearfield);
 var today=(init)?new Date():new Date(yearfield.value*1,monthfield.value*1)
 dayfield.options.length=0;
 for (var i=0; i&lt;new Date(today.getFullYear(),today.getMonth()+1,-1).getDate(); i++) dayfield.options[i]=new Option(i+1,i+1)
 dayfield.selectedIndex=(init)?today.getDate()-1:0; //select today's day
 if (init){
  for (var m=0; m&lt;12; m++) monthfield.options[m]=new Option(monthtext[m],m);
 }
 monthfield.selectedIndex=(init)?today.getMonth():0; //select today's day
 if (init){
  var thisyear=today.getFullYear()
  for (var y=0; y&lt;20; y++)  yearfield.options[y]=new Option(thisyear, thisyear++)
 }
}
                                                                // function validate
 function validate_form ()
{
    valid = true;
                                                                // validate name
       if ( document.input.name.value == "" )
        {
                alert ( "Please enter your name" );
                valid = false;
        }
                                                                // validate address
                if ( document.input.address.value == "" )
        {
                alert ( "Please enter your address address" );
                valid = false;
        }                                                       
                                                                // validate suburb town
                if ( document.input.town.value == "" )
        {
                alert ( "Please enter your Suburb or town" );
                valid = false;
        }


                                                            // validate postcode        

        var y = document.getElementById('postcode').value;
       if(isNaN(y)||y.indexOf(" ")!=-1)
       {
          alert("Postcode must be in numbers.");
          document.getElementById('postcode').focus();
          return false;
       }

       if (y.length&gt;4 || y.length&lt;4)
       {
            alert("Postcode should be 4 digit");
            document.getElementById('postcode').focus();
            return false;
       }  

                                                                // validate home phone
 var y = document.getElementById('hphone').value;
       if(isNaN(y)||y.indexOf(" ")!=-1)
       {
          alert("Home Phone number must be in numbers.");
          document.getElementById('hphone').focus();
          return false;
       }

       if (y.length&gt;10 || y.length&lt;10)
       {
            alert("Home Phone number should be 10 digit");
            document.getElementById('hphone').focus();
            return false;
       }
                                                                // validate work phone
        var y = document.getElementById('wphone').value;
       if(isNaN(y)||y.indexOf(" ")!=-1)
       {
          alert("work Phone number must be in numbers.");
          document.getElementById('wphone').focus();
          return false;
       }

       if (y.length&gt;10 || y.length&lt;10)
       {
            alert("Work Phone number should be 10 digit");
            document.getElementById('wphone').focus();
            return false;
       }
                                                                // validate fax
        var y = document.getElementById('fax').value;
       if(isNaN(y)||y.indexOf(" ")!=-1)
       {
          alert("Fax number must be in numbers.");
          document.getElementById('fax').focus();
          return false;
       }

       if (y.length&gt;10 || y.length&lt;10)
       {
            alert("Fax Phone number should be 10 digit");
            document.getElementById('fax').focus();
            return false;
       }
                                                                // validate email   
        {
        var x=document.forms["input"]["email"].value;
        var atpos=x.indexOf("@");
         var dotpos=x.lastIndexOf(".");
         if (atpos&lt;1 || dotpos&lt;atpos+2 || dotpos+2&gt;=x.length)
         {
         alert("Not a valid e-mail address");
        return false;
        }
        }    
        {

                                                                // validate radio buttons
 var o = document.getElementById('1');
 var t = document.getElementById('2');

if ( (o.checked == false ) &amp;&amp; (t.checked == true ) )
 {
                                                                // validate alternative address
                        if ( document.input.street.value == "" )
        {
                alert ( "Please enter alternative address address" );
                valid = false;
        }                                                       
                                                                // validate suburb town
                if ( document.input.suburb.value == "" )
        {
                alert ( "Please enter alternative Suburb or town" );
                valid = false;
        }
                                                                // validate postcode    

       var y = document.getElementById('postcode2').value;
       if(isNaN(y)||y.indexOf(" ")!=-1)
       {
          alert("Postcode must be in numbers.");
          document.getElementById('postcode2').focus();
          return false;
       }

       if (y.length&gt;4 || y.length&lt;4)
       {
            alert("Alternative Postcode should be 4 digit");
            document.getElementById('postcode2').focus();
            return false;
       }                                                                                            
                                                                    // validate message box
        var o = document.getElementById('card');
        if ( (o.checked == true ))
        {
        if ( document.input.message.value == "" )
        {
                alert ( "Please enter message" );
                valid = false;                                                  
        }
        return valid;
        }
     }
        }                                           

}
&lt;/script&gt;
    &lt;input type="submit" value="Submit" /&gt;
</code></pre>
