marcoalmeida Posted April 23, 2009 at 11:21 AM Report #258546 Posted April 23, 2009 at 11:21 AM Fiz tipo uma textbox e um button pa fazer uma pesquisa da base de dados masq ueria que ao clicar no botão enter do teclado fazer a pesquisa. Preciso de ajuda 😛 Abraços 😛
bruno1234 Posted April 23, 2009 at 03:06 PM Report #258606 Posted April 23, 2009 at 03:06 PM A TextBox é uma asp:TextBox? Se for podes trocar por um <input type="submit"... assim qd carregas no enter ele faz o submit. Matraquilhos para Android. Gratuito na Play Store. https://play.google.com/store/apps/details?id=pt.bca.matraquilhos
Hellblazer Posted April 24, 2009 at 11:53 AM Report #258801 Posted April 24, 2009 at 11:53 AM por javascript B) document.onkeydown = function() { if( !e ) { if( window.event ) { //Internet Explorer e = window.event; } else { return; } } if( typeof( e.keyCode ) == 'number' ) { //DOM e = e.keyCode; } else if( typeof( e.which ) == 'number' ) { //NS 4 compatible e = e.which; } else if( typeof( e.charCode ) == 'number' ) { //also NS 6+, Mozilla 0.9+ e = e.charCode; } else { //total failure, we have no way of obtaining the key code return; } if(e==13) { document.getElementById('btnSubmit').click(); } }; There are two ways to write error-free programs; only the third one works.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now