Javascript: Different response between "Click" and "Enter key"
<p>I've done a website in which the user needs to click on a button after he fills a textbox. When he presses the image changes (it is like a slidshow on command). My problem is that when you touch "enter" instead of clicking with mouse, it doesn't make the fade effect.</p>

<p>The website is this, so that you can try: <a href="http://www.tuttoscorre.net/esame-storia-arte-moderna.php" rel="nofollow">http://www.tuttoscorre.net/esame-storia-arte-moderna.php</a></p>

<p>How con I handle this?</p>

<p>The purpose of the website is to store in a javascript array the answer written in the textbox to show it at the end of the slideshow (10 slides).</p>

<p>Here is the code of the button and of the slideshow:</p>

<pre><code>    &lt;script type="text/javascript"&gt;
        //Dichiaro Array Globale
        var risposte = new Array();
        var count = 0;
        $('.risultati').css({opacity: 0.0});

        //Salvo risposta, svuoto text, proseguo con le slide
        function conferma(frm) {
            if (frm.nome.value == "") alert("Non hai scritto nulla!");
            else {
                risposte[count] = frm.nome.value;
                count = count + 1;
                frm.nome.value = "";
                prossima();
            }
        }

        //Nuova slide sempre verso dx
        function prossima(frm) {
            var $active = $('#slideshow img.active');

            if (!$active.next('img').length) {
                risultati();
            } else {
                var $next = $active.next(); 

                $next.css({opacity: 0.0})
                    .addClass('active')
                    .animate({opacity: 1.0}, 1000, function() {
                        $active.removeClass('active');
                    });
            }

        }

        //Tolgo slide e mostro risultati
        function risultati() {
            $('#slideshow').animate({opacity: 0.0}, 1000);
            $('#compila').animate({opacity: 0.0}, 1000);
            $('#risultati').animate({opacity: 1.0}, 1000, function() {
                $('#risultati').addClass('visibile');
            });

            $('#1').append(risposte[0] + "&lt;br/&gt;Risposa corretta: " + "&lt;?php echo $soluzioni[0]; ?&gt;");
            $('#2').append(risposte[1]+ "&lt;br/&gt;Risposa corretta: " + "&lt;?php echo $soluzioni[1]; ?&gt;");
            $('#3').append(risposte[2]+ "&lt;br/&gt;Risposa corretta: " + "&lt;?php echo $soluzioni[2]; ?&gt;");
            $('#4').append(risposte[3]+ "&lt;br/&gt;Risposa corretta: " + "&lt;?php echo $soluzioni[3]; ?&gt;");
            $('#5').append(risposte[4]+ "&lt;br/&gt;Risposa corretta: " + "&lt;?php echo $soluzioni[4]; ?&gt;");
            $('#6').append(risposte[5]+ "&lt;br/&gt;Risposa corretta: " + "&lt;?php echo $soluzioni[5]; ?&gt;");
            $('#7').append(risposte[6]+ "&lt;br/&gt;Risposa corretta: " + "&lt;?php echo $soluzioni[6]; ?&gt;");
            $('#8').append(risposte[7]+ "&lt;br/&gt;Risposa corretta: " + "&lt;?php echo $soluzioni[7]; ?&gt;");
            $('#9').append(risposte[8]+ "&lt;br/&gt;Risposa corretta: " + "&lt;?php echo $soluzioni[8]; ?&gt;");
            $('#10').append(risposte[9]+ "&lt;br/&gt;Risposa corretta: " + "&lt;?php echo $soluzioni[9]; ?&gt;");
        }

    &lt;/script&gt;
</code></pre>

<p>And this is the form with the button:</p>

<pre><code>        &lt;form id="compila"&gt;
                &lt;input id="enterTxt" class="okText" type="text" name="nome" /&gt;
                &lt;input id="enterButt" class="okIcon" type="Button" value="ok" onClick="conferma(this.form)"&gt;
            &lt;/form&gt;
</code></pre>

<p>Thanks a lot.</p>
