hey bohdan, thanks, works fine! dirk
On 30 Jan., 11:51, Bohdan Ganicky <bohdan.gani...@gmail.com> wrote: > Hi, > just stick with the submit event. It's fired either when user presses > Enter or clicks the submit button: > > $("#searchForm").submit(function() { > var url = 'http://gdata.youtube.com/feeds/api/videos?q='+ $ > ('#searchText').val() + '&alt=json-in-script&callback=showMyVideos&max- > results=7&format=5'; > $.getScript(url); > > return false; > > }); > > -- > Bohdan > > On Jan 30, 11:25 am, dirk w <dirkwendl...@googlemail.com> wrote: > > > hello, > > i've a text inpput field and a button. if you click on the button a > > java script gets called (and all works fine) but if you type some text > > and push the enter button than the whole page gets reloaded on the > > form submit. i know how to prevent the browser to reload the whole > > page (by catching the enter button action) but i don't know how to > > make it do the same like pressing the submit button: > > > # HTML > > <form id="searchForm" action=""> > > <input type="text" name="searchText" id="searchText" value="" > > size="50" maxlength="50"/> > > <input type="button" name="searchButton" id="searchButton" > > class="button buttonText" value="Search" /> > > </form> > > > # JS > > $("form:first").submit(function() > > { > > return false; > > /* INSTEAD OF DOING NOTHING THIS SHOULD DO THE SAME > > THAN THE FOLLOWING ACTION */ > > }); > > > // fire the search when people click on the search button > > $("#searchButton").click(function() > > { > > var url = 'http://gdata.youtube.com/feeds/api/videos?q='+ > > $('#searchText').val() + > > > > '&alt=json-in-script&callback=showMyVideos&max-results=7&format=5'; > > > $.getScript(url); > > > }); > > > your help is much appreciated. i really love jquery, especially > > because of it's community, never got so great responses than in this > > user group. > > > thanks in advance! > > dirk