jquery post - update db - multiple rows
not sure if what i'm trying to do is simple or not:  here it is:

Have rows of data in a table.  the last 3 fields are text fields, they take user input.  each row has it's own UPDATE button.

I'm using the following code to try and do a jquery .ajax post, but, i'm seeing my issue - i'm assigning IDs to my input fields, and you can only have one ID declared per page...so i'm sure that's one issue.

I'm trying to make it so that you click the UPDATE button, it passes the variables from that row in the INPUT boxes and the hidden INPUT field for the rowID, and calls a .php file that updates the DB.

    $(function() {
    $(".submit").click(function() {
        var status = $("#status").val();
        var ly = $("#ly").val();
        var rt = $("#rt").val();
        var offerout = $("#offerout").val();
		var lineid = $("#lineid").val();
		var dataString = 'status='+ status + '&ly=' + ly + '&rt=' + rt + '&offerout=' + offerout + '&lineid=' + lineid;
 
            $.ajax({
            type: "POST",
            url: "post/updatedata.php",
            data: dataString,
            success: function(){
                $('.success').fadeIn(200).show();
                $('.error').fadeOut(200).hide();}
            });
        
        return false;
    });
});
</script>

and my form, one line of it...(each line similar, but different hidden ID variable)

    <form method="POST" name="form">
    <td>This one</td><td>Los Angeles</td>
    <td>CA</td><td>94591</td>
    <td>220000</td>
    <td>20000</td><td>24500</td>
    <td>-5500</td><td>12</td>
    <td>0</td><td>0.167</td><td>4</td>
    <td>1</td><td>1898</td>
    <td></td><td>1</td><td>211335190</td>
    <td><input size="6" type="text" id="status" name="status"></td>
    <td><input size="6" type="text" id="ly" name="ly"></td>
    <td><input size="6" type="text" id="rt" name="rt"></td>
    <td><select id="offerout" name="offerout"><option value="No">No</option><option value="Yes">Yes</option></select></td>
    <input type="hidden" name="lineid" id="lineid" value="97">
    <td><input type="submit" class="submit" value="Update"></td>
    </form>


Thanks in advance, been working for days on this!
916

jquery post - update db - multiple rows
===

not sure if what i'm trying to do is simple or not:  here it is:

Have rows of data in a table.  the last 3 fields are text fields, they take user input.  each row has it's own UPDATE button.

I'm using the following code to try and do a jquery .ajax post, but, i'm seeing my issue - i'm assigning IDs to my input fields, and you can only have one ID declared per page...so i'm sure that's one issue.

I'm trying to make it so that you click the UPDATE button, it passes the variables from that row in the INPUT boxes and the hidden INPUT field for the rowID, and calls a .php file that updates the DB.

    $(function() {
    $(".submit").click(function() {
        var status = $("#status").val();
        var ly = $("#ly").val();
        var rt = $("#rt").val();
        var offerout = $("#offerout").val();
		var lineid = $("#lineid").val();
		var dataString = 'status='+ status + '&ly=' + ly + '&rt=' + rt + '&offerout=' + offerout + '&lineid=' + lineid;
 
            $.ajax({
            type: "POST",
            url: "post/updatedata.php",
            data: dataString,
            success: function(){
                $('.success').fadeIn(200).show();
                $('.error').fadeOut(200).hide();}
            });
        
        return false;
    });
});
</script>

and my form, one line of it...(each line similar, but different hidden ID variable)

    <form method="POST" name="form">
    <td>This one</td><td>Los Angeles</td>
    <td>CA</td><td>94591</td>
    <td>220000</td>
    <td>20000</td><td>24500</td>
    <td>-5500</td><td>12</td>
    <td>0</td><td>0.167</td><td>4</td>
    <td>1</td><td>1898</td>
    <td></td><td>1</td><td>211335190</td>
    <td><input size="6" type="text" id="status" name="status"></td>
    <td><input size="6" type="text" id="ly" name="ly"></td>
    <td><input size="6" type="text" id="rt" name="rt"></td>
    <td><select id="offerout" name="offerout"><option value="No">No</option><option value="Yes">Yes</option></select></td>
    <input type="hidden" name="lineid" id="lineid" value="97">
    <td><input type="submit" class="submit" value="Update"></td>
    </form>


Thanks in advance, been working for days on this!
916
