私はphp whileループを使用していて、ajaxの値を取得したいと考えています。私のコードは、フォーム上のAJAX用のループが提出している間に値を取得するために案内してくださいwhileループを使用して入力フィールド値を取得する方法
while{
<form class="commentform">
<input type="hidden" class="proid" name="proid[]" value="<?=$rr['id']?>">
<input type="text" class="form-control wac" name="comval[]" placeholder="Write a comment..">
</form>
}
<script type="text/javascript">
$(document).ready(function(){
$('.commentform').on('submit', function(e){
var comment = $(this).next('.proid').attr('value');
$('#res').html(comment);
alert(comment);
return false;
<script>
です。ありがとうございます。
何'while'の場合ですか? –