title: database getting updated wrong from custom module form after validation
body: <p>Hi I am working on a custom module form in Magento. I have used the default validation given by Magento.</p>
  
  <p>Here is my form and passing form id to varienform</p>
  
  <pre><code>&lt;form id="my-custom-form" action=""  method="post"&gt;
    &lt;label&gt; Form&lt;/label&gt;
  
    &lt;label&gt;First Name&lt;/label&gt;
    &lt;strong&gt;:&lt;/strong&gt;
    &lt;input class="input-text required-entry" type="text" name="fname" maxlength="20"&gt;&lt;br&gt;
    &lt;label&gt;Last Name&lt;/label&gt;
    &lt;strong&gt;:&lt;/strong&gt;
    &lt;input class="input-text required-entry" type="text" name="lname" maxlength="20"&gt;&lt;br&gt;
    &lt;label&gt;Address&lt;/label&gt;
    &lt;strong&gt;:&lt;/strong&gt;
    &lt;textarea class="required-entry" placeholder="Type your address" name="address"&gt;&lt;/textarea&gt;&lt;br&gt;
    &lt;label&gt;State&lt;/label&gt;
    &lt;strong&gt;:&lt;/strong&gt;
    &lt;input class="required-entry" type="text" maxlength="20" name="state"&gt;&lt;br&gt;
    &lt;label&gt;City&lt;/label&gt;
    &lt;strong&gt;:&lt;/strong&gt;
    &lt;input class="required-entry" type="text" maxlength="20" name="city"&gt;&lt;br&gt;
    &lt;label&gt;Mobile No&lt;/label&gt;
    &lt;strong&gt;:&lt;/strong&gt;
    &lt;input class="required-entry" type="number" maxlength="10" name="mobileno"&gt;    &lt;br&gt;
    &lt;input type="submit" name="submit" value="submit"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
    &lt;input type="button" name="Cancel" value="cancel"&gt;
  &lt;/form&gt;
  
  &lt;script type="text/javascript"&gt;
    //&lt; ![CDATA[
      var customForm = new VarienForm('my-custom-form');
    //]]&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>I have added the db insert in indexcontroller</p>
  
  <pre><code>&lt;?php
  class MyCustom_Helloworld_IndexController extends     Mage_Core_Controller_Front_Action
  {
  
    /*
    * this method privides default action.
    */
    public function indexAction()
    {
    $param = $this-&gt;getRequest()-&gt;getParams();
  
    $firstname = $param['fname'];
    $lastname = $param['lname'];
    $address = $param['address'];
    $state = $param['state'];
    $city = $param['city'];
    $mobile = $param['mobileno'];
  
    $model = Mage::getModel('helloworld/helloworld');
    // $model-&gt;setTitle($title);
    $model-&gt;setFirstname($firstname);
    $model-&gt;setLastname($lastname);
    $model-&gt;setAddress($address);
    $model-&gt;setState($state);
    $model-&gt;setCity($city); 
    $model-&gt;setMobileno($mobile); 
    $model-&gt;save();   
  
    /*
    * Initialization of Mage_Core_Model_Layout model
    */
    $this-&gt;loadLayout();
    /*
    * Building page according to layout confuration
    */
    $this-&gt;renderLayout();
  
    }
  }
  </code></pre>
  
  <p>When I run my module the form appears and when I add no values and click submit the validation errors are getting displayed so no problem with validation but when I checked into db the tables are getting updated with null values. What could be the reason ?</p>