OK, I've fixed it. I also had a table which was used to align elements
which I had omitted for clarity. I looked up prev(), and saw that it
looks for the "unique previous element" ... removed the table and all
is OK.

My code us now this:

(in myapp.js )

$(document).ready(function() {
  $('#find_member_button').click(function() {
    var username = $(this).prev().val();
    $("#member_info").html(username);
    return false;
  });

});

(in the html )

<p id="member_info"></p>

<input type="text" size="30" id="username">
<input type="button" id="find_member_button"size="30" value="Find by Username">

which is WAY cleaner. Thanks. I learned a few things :-)


On 1/4/07, Daniel McBrearty <[EMAIL PROTECTED]> wrote:
> and yes, I've gone over to using a button type, and will likely cut
> out the form tags too. thanks for that suggestion Doug.
>
> --
> Daniel McBrearty
> email : danielmcbrearty at gmail.com
> www.engoi.com : the multi - language vocab trainer
> BTW : 0873928131
>


-- 
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to