Set an empty value to a textarea according to checkboxes
<p>I have a little problem with some jQuery code. </p>

<p>In my page I have the following layout :</p>

<pre><code>[X] "Some text"   [textarea]
[X] "Some text 2" [textarea]
[X] "Some text 3" [textarea]
</code></pre>

<p>So basically, it's just some checkboxes and some textarea (which is a date-picker in fact), and the code is the following (generated in PHP) :</p>

<pre><code>&lt;input type="checkbox" class="pack_check" disabled="disabled" name="id_pack[]" value="0 /&gt;     
Some text
&lt;input name="date-pack[]" id="date-pack[]" class="date-picker"&gt;
&lt;input type="checkbox" class="pack_check" disabled="disabled" name="id_pack[]" value="1 /&gt;     
Some text 2
&lt;input name="date-pack[]" id="date-pack[]" class="date-picker"&gt;
</code></pre>

<p>The thing is, I want that when the user uncheck a checkbox, the associated date (in the textarea input) get an empty value...</p>

<p>I achieved this by doing something like that :</p>

<pre><code>$('input.pack_check').change(function () {
        $("input[name='date-pack[]']").val("");
});
</code></pre>

<p>But when I do this, ALL the textarea are being erased.</p>

<p>Any idea?</p>
