Getting [Object object]
<p>I have a problem with my delete script. 
When a user clicks on a button the data must deleted from the database.
But when I'm looking in the database the value is no [object Object]. </p>

<p>How can I solve this problem? How can I get a empty value in my database, so that the rule is definitely empty. </p>

<p>javascript</p>

<pre><code>function clear_form_elements(ele) {
var theURL = "autosave.php";
  $(ele).find(':input').each(function() {
    switch(this.type) {
        case 'text':
            $(this).val('')
            var statusVal = $(this).val();
            var nameValue = $(this).attr('name');
              $.ajax({ type: "POST", url: theURL, data: nameValue + "=" + statusVal, success: function() {} })

            break;
    }
  });
}
</code></pre>

<p>autosave.php   </p>

<pre><code>if($_POST['update_pageFourofourRuleThree']) { update_option('we_page_fourofour_rule_three', esc_html($_POST['update_pageFourofourRuleThree'])); }
</code></pre>

<p>html</p>

<pre><code>&lt;li class="value_big"&gt;
  &lt;div id="pageFourofourRuleThree"&gt;
   &lt;div style="background-color: #&lt;?php echo get_option('we_page_fourofour_rule_three'); ?&gt;"&gt;&lt;/div&gt;&lt;/div&gt; 
        &lt;fieldset id="wp_page_fourofour_rule_three"&gt;
          &lt;textarea cols="38" rows="5" id="page_fourofour_rule_three" name="update_pageFourofourRuleThree" /&gt;&lt;?php echo get_option('we_page_fourofour_rule_three'); ?&gt;&lt;/textarea&gt;
        &lt;/fieldset&gt;
&lt;/li&gt;
&lt;li class="option_big"&gt;
  &lt;div class="remove_button"&gt;&lt;input onclick="clear_form_elements('#wp_page_fourofour_rule_three')" type="button" /&gt;&lt;/div&gt;
&lt;/li&gt;
</code></pre>
