On 1/4/07, Karl Swedberg <[EMAIL PROTECTED]> wrote: > I should have mentioned that I changed the HTML as well. I added an ID to > the submit button (submit-member). Notice how the event is being triggered > now: $('#submit-member').click(function() {...}); >
yes, I have that, and the event is happening - I can fire an alert or set the html to a fixed string OK. > Since var username = $(this).prev().val() is appearing inside the click > method, $(this) refers to the submit button, prev() refers to the previous > sibling of that button, which should be the text input, and val() refers to > the value of that text input. > That's what I figured, but it doesn't seem to work. I always get null. I'm trying to figure it out using FireBug and alert boxes and so on. I realise this is not really a jquery issue though ... I think. More my (lack of) knowledge about the DOM and js. > Now I'm wondering, though, what you're trying to accomplish with the code. > As Doug noted, it doesn't look like you really need a form at all to do what > you're trying to do. But it's kind of hard to advise on that without knowing > the larger context. > The context is that indeed, I don't need the submit behaviour here - this is some admin code of my site, and I know I will always use firefox and have javascript turned on. SO it's a good place to start using some js/ajax techniques without yet worrying about how to make things work for other browsers and users without js. Once I have the text input being captured OK in the click method, I will use it in a server call and then use it to set the html. one step at a time though ... -- 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/