Getting value of dynamically generated textfield
<p>I have a table that has been generated dynamically using PHP. The table has a few textfields which are being used to update the database based on the row. This question can be referred at: <a href="http://stackoverflow.com/questions/9726265/save-dynamically-generated-textfield-from-php">Complete question</a>, based on one for the answer i am using javascript which gets the textfield value when enter is pressed. The javascript being used is:</p>

<pre><code>$("#details input").live('keypress', function (e) {
    var code = (e.keyCode ? e.keyCode : e.which);
    if (code == 13) {
        e.preventDefault();
        var ourId = $(this).id;
        var updatedText = $(this).val;

        alert(updatedText);
    }
});
</code></pre>

<p>However for some reason <code>$(this)</code> isn't returning the expected result.</p>

<p>Any help will be appreciated, thanks.</p>
