[eluser]RobertB.[/eluser]
Hello guys,
Trying to update multiple rows in a table. I also need to validate the field.
table
id | price
I'm sending this array from the view to the controller
Code:
//form field
<input id="1" type="text" value="24.95" name="price[1]">
//Get me this array
Array
(
[1] => 24.94
[2] => 24.94
[7] => 24.94
[8] => 24.94
[9] => 24.94
)
The js file
Code:
$('#submit').live('click', function(){
$.ajax({
url: "selector/editPrices",
type: "POST",
dataType: "html",
data: $('#content :input').serialize(),
beforeSend: function(){
//showLoader();
},
success: function(data) {
alert(data);
//processed(html);
}
});
});
The Controller
Code:
function editPrices()
{
$price = $this->input->post('price');
print_r($price);
}
I need to update the table after validation
Thanks in advanced