title: storing cookies and retrieving them in the html form values using php
body: <p>hi friends i have created a form as below and tried to set cookies for every-field, i succeed in setting cookies for the input text boxes, but i failed to do the same for textarea fields and for drop-down list as well as for check-boxes. The form is as below....    </p>
  
  <pre><code>&lt;input name="date" type="text" size="10" value="&lt;?php if(isset($_COOKIE["date"])) echo $_COOKIE["date"];?&gt;" onblur="setCookie(this.name,this.value,60*60*2)" /&gt;&lt;/td&gt;
            Order Number:
            &lt;input name="order_num" type="text" size="10" value="&lt;?php if(isset($_COOKIE["order_num"])) echo $_COOKIE["order_num"];?&gt;" onblur="setCookie(this.name,this.value,60*60*2)" /&gt;
           First Name:
            &lt;td&gt;&lt;input name="fname" type="text" value="&lt;?php if(isset($_COOKIE["fname"])) echo $_COOKIE["fname"];?&gt;" onblur="setCookie(this.name,this.value,60*60*2)"/&gt;&lt;/td&gt;
            Last Name:
            &lt;td&gt;&lt;input name="lname" type="text" value="&lt;?php if(isset($_COOKIE["lname"])) echo $_COOKIE["lname"];?&gt;" onblur="setCookie(this.name,this.value,60*60*2)"/&gt;
  
            Image Submitted:
            &lt;input name="image" type="text" value="&lt;?php if(isset($_COOKIE["image"])) echo $_COOKIE["image"];?&gt;" onblur="setCookie(this.name,this.value,60*60*2)"/&gt;
            General Comments:
           &lt;textarea name="gen_comments" cols="50" rows="6"  onblur="setCookie(this.name,text,60*60*2)" &gt;&lt;?php if(isset($_COOKIE["gen_comments"])) { echo $_COOKIE["gen_comments"];}?&gt;&lt;/textarea&gt;
  
            Internal Comments:
            &lt;textarea name="int_comments" cols="50" rows="6" onblur="setCookie(this.name,text,60*60*2)"&gt;&lt;?php if(isset($_COOKIE["int_comments"])) { echo $_COOKIE["int_comments"];}?&gt;&lt;/textarea&gt;
           Quality of the File:
             &lt;select name="quality" onchange="" &gt;
             &lt;option &gt;Select One&lt;/option&gt;&lt;option name="good" value="&lt;?php if(isset($_COOKIE["good"])) echo $_COOKIE["good"];?&gt;"&gt;Good&lt;/option&gt;&lt;option value="ok"&gt;A bit low but we can use it&lt;/option&gt;&lt;option value="low"&gt;Low. We are concerned it might effect the qaulity of the final&lt;/option&gt;&lt;option value="not good"&gt;Not good. We cannot work with it&lt;/option&gt;&lt;option value="test2"&gt;test2&lt;/option&gt;&lt;option value="test"&gt;test&lt;/option&gt;&lt;option value="lkdjfalkdjlaksjdla dlkajsdaksjdlkajsdlkjaslkdjas alksdjaslkdjlaksjdla"&gt;Lisa1&lt;/option&gt;&lt;option value="bbb"&gt;aaa&lt;/option&gt;        &lt;!--option value="good"&gt;Good&lt;/option&gt;
             &lt;option value="ok"&gt;A bit low but we can use it&lt;/option&gt;
             &lt;option value="low"&gt;Low. We are concerned it might effect the qaulity of the final &lt;/option&gt;
             &lt;option value="not good"&gt;Not good. We can't work with it&lt;/option--&gt;
              &lt;/select&gt; 
            &lt;input type="button" name="qofoption" id="qofoption" value="Add New Option" 
            onClick="optionWindow('http://www.lightaffection.com/Hema2/addnewoption.php?option=qof','optionwindow','400','200')"/&gt;        &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;&lt;div name="qofdiv"&gt;&lt;/div&gt;&lt;/tr&gt;
          &lt;tr&gt;
            &lt;td align="right"&gt;Image Proportions and Content:&lt;/td&gt;
            &lt;td colspan="2" style="padding-right:4px"&gt;
             &lt;select name="imageprop" id="imageprop"&gt;
             &lt;option&gt;Select One&lt;/option&gt;&lt;option value="test2"&gt;test2&lt;/option&gt;&lt;option value="not good"&gt;Too much details for a Night Light&lt;/option&gt;&lt;option value="good"&gt;Good&lt;/option&gt;&lt;option value="test"&gt;test&lt;/option&gt;&lt;option value="asdas"&gt;asdsa&lt;/option&gt;&lt;option value="bbb"&gt;bbb&lt;/option&gt;
            &lt;td&gt;&lt;b&gt;How would you like us to proceed?&lt;/b&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
  
           &lt;input type="checkbox" name="proceed_opt[]" value="I will upload new Image"&gt;
                Insert Option &amp;quot;I will upload new Image&amp;quot;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td colspan="2"&gt;
                  &amp;nbsp; 
                &lt;input type="checkbox" name="proceed_opt[]" value="I approve this sample for a Night Light"&gt;
                Insert Option &amp;quot;&lt;font face="Arial, Helvetica, sans-serif" size="2"&gt;I approve this sample for a Night Light&lt;/font&gt;&amp;quot; &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td colspan="2"&gt;
                  &amp;nbsp; 
                &lt;input type="checkbox" name="proceed_opt[]" value="Select One"&gt;
                Insert Option &amp;quot;&lt;font face="Arial, Helvetica, sans-serif" size="2"&gt;Select One&lt;/font&gt;&amp;quot; &lt;/td&gt;&lt;/tr&gt;     
           &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td colspan='2'&gt; &amp;nbsp;
           &lt;input type="checkbox" name="proceed_opt[]" value="other"&gt;
                Insert Option &amp;quot;Other See comments&amp;quot;&lt;/td&gt;&lt;/tr&gt;
  
            &lt;td&gt; Ship by date: &lt;input name="shipdate" type="text" /&gt;&lt;br /&gt;
            &lt;br /&gt;
            Update Order Status to: &lt;select name="orderstatus"&gt;
              &lt;option&gt;Do not change&lt;/option&gt;
              &lt;option&gt;Waiting for designer&lt;/option&gt;
              &lt;option&gt;Waiting for customer response&lt;/option&gt;
            &lt;/select&gt;
            &lt;br /&gt;
            &lt;input name="ordermanager" type="checkbox" value="" /&gt; Update Order Manager &lt;br /&gt;
            &lt;input name="createhtml" type="checkbox" value="" /&gt; Create an HTML page &lt;br /&gt;
            &lt;input name="sendemail" type="checkbox" value="" /&gt; Send Email to Customer &lt;br /&gt;      &lt;/td&gt;
  
  
      &lt;/form&gt;
  </code></pre>
  
  <p>thanks in advance..</p>