Qualcuno saprebbe dirmi come si imposta un pulsante prederinito che viene azionato quando si preme enter ?
Qualcuno saprebbe dirmi come si imposta un pulsante prederinito che viene azionato quando si preme enter ?
http://www.gak.altervista.org - Gruppo Astrofili Keplero
http://www.oradistelle.altervista.org
http://fun.supereva.it/geronzio/
http://www.orion42.altervista.org
http://www.matrixuniverse.altervista.org
http://www.silverblood.altervista.org
http://www.otticaroma3.altervista.org
fai così
quando premi enter (window.event.keyCode==13) viene chiamato l'evento click del pulsante che visualizza un alertcodice:<script language="javascript"> function tasti() { if (window.event.keyCode==13 ) { button1.click() } } window.document.onkeydown=tasti </script> <INPUT type="button" value="Button" id=button1 name=button1 onclick="alert('ciao')">
ciao![]()
:quote: grazie e Buon Natale
:bubu:
http://www.gak.altervista.org - Gruppo Astrofili Keplero
http://www.oradistelle.altervista.org
http://fun.supereva.it/geronzio/
http://www.orion42.altervista.org
http://www.matrixuniverse.altervista.org
http://www.silverblood.altervista.org
http://www.otticaroma3.altervista.org
Non riesco ad inserire il codice come volevo. Volevo mettere un campo password in modo che tu inserivi il nome --> premevi invio --> andavi alla pagina come se avessi premuto il pulsante enter
Aiutami non sono capace di farlo da solo !!!!
Questo e' il codice della mia pagina :
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Esempi Javascript: esempio pratico</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<SCRIPT language=javascript src="passssssss_file/js"></SCRIPT>
<!-- Codice scaricato gratuitamente da HTML.it, il sito italiano sul Web publishing
http://www.html.it -->
<SCRIPT language=JavaScript>
function hidden(){
var location=document.input.password.value + ".htm";
this.location.href = location;
}
// -- End Hiding Here
// -->
</SCRIPT>
<META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD>
<BODY bgColor=white>
<FORM name=input>
<DIV align=center>
<CENTER>
<TABLE borderColor=#000000 borderColorDark=#000000 width=200 bgColor=#808080
borderColorLight=#000000 border=2>
<TBODY>
<TR>
<TD borderColor=#000000 borderColorLight=#000000 align=middle
bgColor=#808080 borderColorDark=#000000>
<TABLE border=0>
<TBODY>
<TR>
<TD><FONT color=#000000>Password:</FONT></TD></TR>
<TR>
<TD><INPUT size=25 name=password> </TD></TR>
<TR>
<TD align=right><INPUT onclick=hidden() type=button value=Enter>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></CENTER></DIV></FORM>
<DIV align=center>
<TABLE width=400 border=0>
<TBODY>
<TR>
<TD>
<DIV align=center><FONT face="Arial, Helvetica, sans-serif">USA QUESTE
DUE PASSWORD</FONT></DIV></TD></TR></TBODY></TABLE></DIV>
<DIV align=center>
<TABLE width=400 border=0>
<TBODY>
<TR>
<TD>
<DIV align=center><FONT
face="Arial, Helvetica, sans-serif">pass</FONT></DIV></TD>
<TD>
<DIV align=center><FONT
face="Arial, Helvetica, sans-serif">pass2</FONT></DIV></TD></TR></TBODY></TABLE></DIV>
<DIV style="LEFT: 150px; POSITION: absolute; TOP: 350px">
<SCRIPT language=JAVASCRIPT>
<!--
var browName = navigator.appName;
var browDateTime = (new Date()).getTime();
var browVersion = parseInt(navigator.appVersion);
var ua=navigator.userAgent.toLowerCase();
var adcode='';
if (browName=='Netscape'){
if (browVersion>=5)
{ document.write('<ifr'+'ame src="http://ad.html.it/banman.asp?ZoneID=36&Task=Get&Browser=NETSCAPE6&X= ' + browDateTime + '" width=468 height=60 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No></ifr'+'ame>'); }
else if ((browVersion>=4)&&(ua.indexOf("mac")==-1))
{ document.write('<S'+'CRIPT src="http://ad.html.it/banman.asp?ZoneID=36&Task=Get&Browser=NETSCAPE4">' );
document.write('</'+'scr'+'ipt>');
document.write(adcode); }
else if (browVersion>=3)
{ document.write(''); } }
if (browName=='Microsoft Internet Explorer')
{ document.write('<ifr'+'ame src="http://ad.html.it/banman.asp?ZoneID=36&Task=Get&X=' + browDateTime + '" width=468 height=60 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No></ifr'+'ame>'); }
// -->
</SCRIPT>
<NOSCRIPT>
[img]passssssss_file/pb.gif[/img]</NOSCRIPT></DIV>
<SCRIPT language=javascript>postamble();</SCRIPT>
</BODY></HTML>
![]()
:master:
![]()
![]()
HELP!!!
http://www.gak.altervista.org - Gruppo Astrofili Keplero
http://www.oradistelle.altervista.org
http://fun.supereva.it/geronzio/
http://www.orion42.altervista.org
http://www.matrixuniverse.altervista.org
http://www.silverblood.altervista.org
http://www.otticaroma3.altervista.org
aggiungi il codice in grassetto
codice:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Esempi java script: esempio pratico</TITLE> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <SCRIPT language=javascript src="passssssss_file/js"></SCRIPT> <!-- Codice scaricato gratuitamente da HTML.it, il sito italiano sul Web publishing http://www.html.it --> <SCRIPT language=JavaScript> function hidden(){ var location=document.input.password.value + ".htm"; this.location.href = location; } // -- End Hiding Here // --> function tasti() { if (window.event.keyCode==13 ) { btnEnter.click() } } window.document.onkeydown=tasti </SCRIPT> <META content="Microsoft FrontPage 5.0" name=GENERATOR></HEAD> <BODY bgColor=white> <FORM name=input> <DIV align=center> <CENTER> <TABLE borderColor=#000000 borderColorDark=#000000 width=200 bgColor=#808080 borderColorLight=#000000 border=2> <TBODY> <TR> <TD borderColor=#000000 borderColorLight=#000000 align=middle bgColor=#808080 borderColorDark=#000000> <TABLE border=0> <TBODY> <TR> <TD><FONT color=#000000>Password:</FONT></TD></TR> <TR> <TD><INPUT size=25 name=password> </TD></TR> <TR> <TD align=right><INPUT onclick=hidden() id="btnEnter" type=button value=Enter> </TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></CENTER></DIV></FORM> <DIV align=center> <TABLE width=400 border=0> <TBODY> <TR> <TD> <DIV align=center><FONT face="Arial, Helvetica, sans-serif">USA QUESTE DUE PASSWORD</FONT></DIV></TD></TR></TBODY></TABLE></DIV> <DIV align=center> <TABLE width=400 border=0> <TBODY> <TR> <TD> <DIV align=center><FONT face="Arial, Helvetica, sans-serif">pass</FONT></DIV></TD> <TD> <DIV align=center><FONT face="Arial, Helvetica, sans-serif">pass2</FONT></DIV></TD></TR></TBODY></TABLE></DIV> <DIV style="LEFT: 150px; POSITION: absolute; TOP: 350px"> <SCRIPT language=JAVASCRIPT> <!-- var browName = navigator.appName; var browDateTime = (new Date()).getTime(); var browVersion = parseInt(navigator.appVersion); var ua=navigator.userAgent.toLowerCase(); var adcode=''; if (browName=='Netscape'){ if (browVersion>=5) { document.write('<ifr'+'ame src="http://ad.html.it/banman.asp?ZoneID=36&Task=Get&Browser=NETSCAPE6&X=' + browDateTime + '" width=468 height=60 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No></ifr'+'ame>'); } else if ((browVersion>=4)&&(ua.indexOf("mac")==-1)) { document.write('<S'+'CRIPT src="http://ad.html.it/banman.asp?ZoneID=36&Task=Get&Browser=NETSCAPE4">'); document.write('</'+'scr'+'ipt>'); document.write(adcode); } else if (browVersion>=3) { document.write(''); } } if (browName=='Microsoft Internet Explorer') { document.write('<ifr'+'ame src="http://ad.html.it/banman.asp?ZoneID=36&Task=Get&X=' + browDateTime + '" width=468 height=60 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No></ifr'+'ame>'); } // --> </SCRIPT> <NOSCRIPT> [img]passssssss_file/pb.gif[/img]</NOSCRIPT></DIV> <SCRIPT language=javascript>postamble();</SCRIPT> </BODY></HTML>
ciao![]()
Non ci riesco proprio con FrontPage mi da un errore:
codice:errore nello script della pagina Linea 22 caratere3 errore: 'btnenter' non è definito
Non puoi mandarmelo in qualche modo ?
Via e-mail ?geronzio@supereva.it
Hai icq ?
Grazie
HELP
http://www.gak.altervista.org - Gruppo Astrofili Keplero
http://www.oradistelle.altervista.org
http://fun.supereva.it/geronzio/
http://www.orion42.altervista.org
http://www.matrixuniverse.altervista.org
http://www.silverblood.altervista.org
http://www.otticaroma3.altervista.org
Devi aggiungere esattamente il codice in grassetto.
Attento che Javascript è case sensitive.
Molto probabilmente devi scrivere btnEnter e non btnenter
ciao
Premesso che non mi prende
un altra cosa :
Hai detto che:
quindi ogni tasto è associato ad un numero,codice:if (window.event.keyCode==13 )
ma hai una lista ? Potresti scrivermela ?
Si trova su internet ? Se si come e con che nome ?
Grazie
:bubu: Buon Natale :bubu:
http://www.gak.altervista.org - Gruppo Astrofili Keplero
http://www.oradistelle.altervista.org
http://fun.supereva.it/geronzio/
http://www.orion42.altervista.org
http://www.matrixuniverse.altervista.org
http://www.silverblood.altervista.org
http://www.otticaroma3.altervista.org
qui trovi tutto.
ciao
Var sei capace di risolvere il mio problema
(vedi sopra ?) :quote:
http://www.gak.altervista.org - Gruppo Astrofili Keplero
http://www.oradistelle.altervista.org
http://fun.supereva.it/geronzio/
http://www.orion42.altervista.org
http://www.matrixuniverse.altervista.org
http://www.silverblood.altervista.org
http://www.otticaroma3.altervista.org