Selamat malam mas elyx, saya dapet masalah kenapa totpoint ga bisa muncul otomatis ya? ini sourcenya...
<span class="number input margin-right">
							<button type="button" class="button number-down">-</button>
							<input type="text" name="qty[<?php echo $no;?>]" value='<?php echo $t['qty']?>' onchange="grandTotal()" size="4" class="qty input-unstyled">
							<button type="button" class="button number-up">+</button>
						</span>
						<input type="text" name="perpoint[<?php echo $no;?>]" value="<?php echo $t['point']?>" onchange="grandTotal()" size="4" class="perpoint" >							
						<input type="text" name="totpoint[<?php echo $no;?>]" value='0' size="4" class="totpoint" >								
						</td>
						<td>
							<span class="button-group compact ">
							<a href="<?php echo $base_url?>/delete-item/<?php echo $t['id']?>/<?php echo $dua?>" class="button icon-trash with-tooltip" title="Delete" onclick='return confirm("Are you sure delete this data?");'></a>
							</span>
						</td>	
					</tr>
					
				<?php $no++;?>
				
				<script type="text/javascript" src="<?php echo $base_url?>/content/project/jquery-1.7.2.min.js"></script>
				<script type="text/javascript">
				$(function(){
					$('.qty').live('keyup',function(){
					var totpoint = $(this).parent().next().next().find('.totpoint');
					var perpoint = $(this).parent().next().find('.perpoint');
					$(totpoint).val($(this).val() * $(perpoint).val());
					});
				});

				
				function grandTotal(){
					var qty = 0;
					$('.qty').each(function(){
					qty += parseFloat($(this).val());
					$('input[name="total_qty"]').val(qty);
					});
				}	

				</script>
				

mohon bantuanya,
Terimakasih...
Silahkan login untuk menjawab!
0
Loading...
Ellyx Christian · Aug 4, 2013 · 0 Suka · 0 Tidak Suka
coba:
$(function(){
	$('.qty').live('keyup',function(){
		var totpoint = $(this).parent().next().next();
		var perpoint = $(this).parent().next();
		$(totpoint).val($(this).val() * $(perpoint).val());
	});
});