I have form like this:
<div class="satu">
<input type='text' size='1' maxlength='1' name='score[1][]' id='score[1][]'>
</div>
<div class="dua">
<input type='text' size='1' maxlength='3' name='weight[1][]' id='weight[1][]'> %
</div>
<div class="tiga">
<input type='text' size='5' name='weightscore[1][]' id='weightscore[1][]' disabled>
</div>
<div class="satu">
<input type='text' size='1' maxlength='1' name='score[2][]' id='score[2][]'>
</div>
<div class="dua">
<input type='text' size='1' maxlength='3' name='weight[2][]' id='weight[2][]'> %
</div>
<div class="tiga">
<input type='text' size='5' name='weightscore[2][]' id='weightscore[2][]' disabled>
</div>
this is the jquery script:
$('[id^="score"]').keyup(function()
{
var score=$('[id^="score"]').val();
var weight=$('[id^="weight"]').val();
$.ajax({
url: "cekweightscore.php",
data: "score="+score+"&weight="+weight,
success:
function(data)
{
$('[id^="weightscore"]').val(data);
}//success
});//ajax
});
this is the php code:
<?php
include "connection.php";
$score = $_GET['score'];
$weight = $_GET['weight'];
$totalweightscore=(($weight * $score )/ 100);
echo"$totalweightscore";
?>
When i keyup on score[1][], the value of weight[1][] is not coming out. PLease Help me, How to get value from multiple input fields on different class ??