I haven't tested this, but I think you'd just select the inputs within
the clone, and reset them before inserting, like so:

var clonedRow = $("tbody.gltb tr#guest_new").clone();
$('input', clonedRow).val('');

- jason





On Jun 2, 11:42 am, jarp <[EMAIL PROTECTED]> wrote:
> new to jquery. here is what I am trying to do.
>
> -- I am using the clone function to clone a table row.
> -- the table row contains 3 input fields
> -- they are inheriting the values already in them
> -- i need to reset them to "" (blank")
>
> $(document).ready(function() {
>     // Initialise the table
>     $("a.addNew").click(function() {
>      var clonedRow = $("tbody.gltb tr#guest_new").clone();
>      //this will grab the last table row.
>         $("tbody.gltb tr#guest_new input").attr("value", "");
>         $("tbody.gltb").append(clonedRow); //add the row back to the
> table
>
>       var n = $("tbody.gltb tr").length;
>       //alert(n);
>       //$("tbody.gltb tr#guest_new input").attr("value", "");
>      //var r = $("tbody.gltb tr").get(n);
>      // now i am lost :-(
>    });
>  });

Reply via email to