echo '<tr>';
foreach($types_show[0] as $size) {
echo '<td>'.Form::radio('radio_size', $size->id) '</td>';
}
echo '</tr>';
Here is the a list of radio buttons. and I use the following ajax code to send the value to php page.
$(':radio[name=radio_size]').click(function(){
var radio_size = $(this).val();
$.ajax({
type: "GET",
url: "/management/order/edit_input",
data: {radio_size:radio_size},
cache: false,
dataType: 'json',
success: function(data) {
$('#search_area').append(data);
},
});
});
The PHP code return a view page which append to the existing #search_area. The problem is when I click a radio with id=7 first time ,it send
GET http://localhost:8008/management/order/edit_input?radio_id=7&_=1410246332142
The second time I click the radio with id=2
GET http://localhost:8008/management/order/edit_input?radio_id=2&_=1410246332143
GET http://localhost:8008/management/order/edit_input?radio_id=2&_=1410246332144
the third time you can see four.
GET http://localhost:8008/management/order/edit_input?radio_id=7&_=1410246332145
GET http://localhost:8008/management/order/edit_input?radio_id=7&_=1410246332146
GET http://localhost:8008/management/order/edit_input?radio_id=7&_=1410246332147
GET http://localhost:8008/management/order/edit_input?radio_id=7&_=1410246332148
But I only want to send it once a time.How to fix it? Thanks.