set each textbox value with jquery
potongan jquery sintax :
$( document ).on( 'click', '#copyall', function( e ) {
var allotment = $('#AllotmentToAll').val();
$('#allotment').each( function() {
$('.allotment').val(allotment);
});
});
echo CHtml::textField('AllotmentToAll','','',array('id'=>'AllotmentToAll'));
echo CHtml::button('Copy To All', array('id'=>"copyall"));
$totDay = date('t', strtotime('2013-01'));
echo "<br />";
echo "<table border=1>";
echo '<tr>';
for($i=1; $i<=$totDay; $i++){
echo '<td>';
echo "2013-01-$i <br />";
echo CHtml::textField('allotment[]', '', array('id'=>"allotment", 'class'=>"allotment", 'size'=>'10px'));
echo "</td>";
if($i % 4 ==0){
echo "</tr>";
}
echo "";
}
echo '</table>';
Comments
Post a Comment
silahkan berkomentar, kritik dan saran yang membangun adalah harapkan kita semua !