Welcome Guest, Not a member yet? Register   Sign In
excuse my ignorance
#1

[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


Messages In This Thread
excuse my ignorance - by El Forum - 03-04-2011, 11:42 AM
excuse my ignorance - by El Forum - 03-04-2011, 11:47 AM
excuse my ignorance - by El Forum - 03-04-2011, 01:03 PM
excuse my ignorance - by El Forum - 03-04-2011, 04:18 PM
excuse my ignorance - by El Forum - 03-04-2011, 04:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB