As several others have pointed out, the problem is that the form is 
submitting.  If that's not what you eventually want to happen, why not 
just make the submit input into a button input (type="button")?

Daniel McBrearty wrote:
> Hi
> 
> Just getting into using js to do things. I'm just experimenting right now.
> 
> Here is my example code:
> 
> 
> <p id="member_info"></p>
> 
> <script type="text/javascript">
>   function findMember(form){
>     $("#member_info").html(form.username.value);
>   }
> </script>
> 
> <form name="find_member" action="" method=GET>
>   <input type="text" size="30" name="username">
>   <input type="submit" onClick="findMember(this.form)" size="30"
> value="Find by Username">
> </form>
> 
> now what happens when I fill in a value and click is that the value I
> entered into the text box appears in the "member_info" <p> ... but
> disappears again almost straight away.
> 
> any ideas?
> 
> thanks. the lib looks nice and clean BTW.
> 
> Daniel
> 

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

Reply via email to