title: add more fields on form and insert into mysql database
body: <p>I have a form and I want to give an add more item link to add three textboxes.User can add upto 7 times. that means user can input 7 items at one time. </p>
  
  <p>the second one is I want to insert these 7 items into mysql tables in separate rows. How can I do it.</p>
  
  <pre><code>&lt;form name="frmaddservice" action="" method="post" class="jNice" onsubmit="return checkaddservice();"&gt;
  
      &lt;p&gt;&lt;label&gt;Customer Name:&lt;/label&gt;&lt;input name="txtcustname" type="text" class="text-long" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;label&gt;Customer Phone:&lt;/label&gt;&lt;input name="txtcustphone" type="text" class="text-long" /&gt;&lt;/p&gt;        
      &lt;p&gt;&lt;label&gt;Customer Email:&lt;/label&gt;&lt;input name="txtcustemail" type="text" class="text-long" /&gt;&lt;/p&gt;
      &lt;div id="fieldset"&gt;
      &lt;p&gt;&lt;label&gt;Item Type:&lt;/label&gt;
          &lt;select name="seltype"&gt;
          &lt;option&gt;Select Type&lt;/option&gt;
          &lt;?php
              while($rowitem = mysql_fetch_assoc($seltype))
              {
          ?&gt;
              &lt;option&gt;&lt;?php echo $rowitem['item_name']; ?&gt;&lt;/option&gt;
          &lt;?php
              }
          ?&gt;
          &lt;/select&gt;
      &lt;/p&gt;
      &lt;p&gt;&lt;label&gt;Item Brand&lt;/label&gt;&lt;input name="txtitembrand" type="text" class="text-long"&gt;&lt;/textarea&gt;&lt;/p&gt;        
      &lt;p&gt;&lt;label&gt;Item Quantity:&lt;/label&gt;&lt;input name="txtqty" type="text" class="text-long" /&gt;&lt;/p&gt;        
      &lt;p&gt;&lt;label&gt;Item Description&lt;/label&gt;&lt;textarea name="txtdesc"&gt;&lt;/textarea&gt;&lt;/p&gt;
      &lt;p&gt;&lt;label&gt;Item Warranty Date:&lt;/label&gt;&lt;input name="txtdate" type="text" class="text-long" /&gt; 
      &lt;script language="JavaScript"&gt;
          new tcal ({
          // form name
          'formname': 'frmaddservice',
          // input name   
          'controlname': 'txtdate'
          });
      &lt;/script&gt;
      &lt;/p&gt;
  
      &lt;input type="submit" value="Add Service"/&gt;
      &lt;/div&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>I have uploaded <a href="http://upendraonline.com/code.txt" rel="nofollow">the file here</a>, please take a look.</p>
  
  <p>Validation code</p>
  
  <pre><code>&lt;SCRIPT TYPE="TEXT/JAVASCRIPT"&gt;function IsNumeric(strString)
  {
      var strValidChars = "0123456789";
      var strChar;
      var blnResult = true;
      if (strString.length == 0) return false;
      for (i = 0; i &lt; strString.length &amp;&amp; blnResult == true; i++)
      {
          strChar = strString.charAt(i);
          if (strValidChars.indexOf(strChar) == -1)
          {
              blnResult = false;
          }
      }
          return blnResult;
  }function checkaddservice(){
  with (window.document)
  {
      if(frmaddservice.txtcustname.value == "")
      {
          alert("Please enter Customer's Name.");
          frmaddservice.txtcustname.focus();
          return false;
      }
      if(frmaddservice.txtcustphone.value == "")
      {
          alert("Please enter Customer's phone.");
          frmaddservice.txtcustphone.focus();
          return false;
      }
      if(IsNumeric(frmaddservice.txtcustphone.value) == "false")
      {
          alert("Please enter Valid phone.");
          frmaddservice.txtcustphone.focus();
          return false;
      }
      for(var i=0; i&lt;7; i++)
      {
          if(frmaddservice.elements["seltype" + i].value == "Select Type")
          {
              alert("Please Select Item Type!");
              return false;
          }
          if(frmaddservice.elements["txtqty" + i].value == "")
          {
              alert("Please Enter Item Quantity!");
              return false;
          }
          var qty = frmaddservice.elements["txtqty" + i].value;
          if(IsNumeric(qty) == "false")
          {
              alert("Please Enter Valid Quantity!");
              frmaddservice.elements["txtqty" + i].focus();
              return false;
          }
      }
  }}&lt;/SCRIPT&gt;
  </code></pre>