show value in textfield dialog when checked
<p>This is the checkbox</p>

<pre><code>&lt;input id="c1" type="checkbox" name="hour[]" class="create-daily" value="1" /&gt;&lt;br /&gt;
&lt;input id="c2" type="checkbox" name="hour[]" class="create-daily" value="2" /&gt;&lt;br /&gt;
&lt;input id="c3" type="checkbox" name="hour[]" class="create-daily" value="3" /&gt;&lt;br /&gt;
</code></pre>

<p>I have a dialog</p>

<pre><code>&lt;div id="form_input" title="Konfirmasi"&gt;
 &lt;?php $data['hour'] = $this-&gt;input-&gt;post('hour');?&gt;
  &lt;table&gt;
    &lt;?php echo form_open('booking/ok'); ?&gt;
    &lt;input type="hidden" value='' id="id" name="id"&gt;
    &lt;input type="hidden" value="&lt;?php echo $sdate?&gt;" id="sdate" name="sdate" /&gt;
    &lt;?php echo "Anda memesan room : &lt;br/&gt;Tanggal :&lt;b&gt; ".$sdate."&lt;/b&gt;&lt;br&gt;";?&gt;
    Jam : &lt;b&gt;&lt;span class="jambooking"&gt;&lt;/span&gt;&lt;/b&gt;
    &lt;tr&gt;
        &lt;td&gt;
        &lt;div class="element"&gt;
            &lt;label class="Norm"&gt;Jam:&lt;/label&gt;
            &lt;input type="text" name="jam" class="jambooking" id="jam" minlength="2" value="" /&gt;
            &lt;/div&gt;

            &lt;label class="Norm"&gt;User:&lt;/label&gt;
            &lt;input type="text" name="user" class="required text" minlength="2" /&gt;
            &lt;/div&gt;
</code></pre>

<p>I have javascript</p>

<pre><code>$(".create-daily").live("click",function(){
         if ($(this).attr("checked")){
             //var date = $(this).attr("date");
             //$('#date').val(date);
            $( "#form_input" ).dialog( "open" );
            $(".jambooking").html( $(":checked").val());
            }
        });
</code></pre>

<p>I use a span and input with a class set to <code>jambooking</code>. When I checked a check box and show a dialog, the span shows a value.</p>

<p>When I set to the input class <code>jambooking</code> the value does not show.</p>

<p>How would I load a value to the text field?</p>
