Please help me,
this html code is in a loop but when i submit the form for fetching the price i.e get-price
button, the price is always coming in first element of h1
tag
loop starts
<form method="post" class="frm">
<input type="hidden" name="rom" value="<?php echo $hash;?>" />
<input type="submit" value='get-price' />
</form>
<h1 id="response"> </h1>
loopends
<script type="text/javascript">
$(".frm").submit(function(e){ //user clicks form submit button
var form_data = $(this).serialize(); //prepare form data for Ajax post
var button_content = $(this).find('button[type=submit]'); //get clicked button info
button_content.html('Adding...'); //Loading button text //change button text
$.ajax({ //make ajax request to cart_process.php
url: "getprice.php",
type: "POST",
data: form_data
}).done(function(data){
$("#response").html(data);
console.log(data);
//this.element = $('#response');
})
e.preventDefault();
});
</script>