Visualizzazione dei risultati da 1 a 3 su 3
  1. #1

    Js x checkForm, dove sta l'errore??

    Ciao a tutti, ho una JS che dovrebbe controllare un paio di campi di un form, solamente che non ne vuole sapere di andare, cioè il form viene inviato senza fare il controllo, dove è l'errore, mi sembra che sia tutto ok..

    Questo è il source:
    codice:
    <?
    
    include ('check.php');
    include ('connect.php');
    										  										  										  
    ?>
    <HTML><HEAD><TITLE>ADMIN</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
    <META http-equiv=MSThemeCompatible content=Yes>
    <META content="MSHTML 6.00.2600.0" name=GENERATOR>
    <link rel="stylesheet" href="../1.css" type="text/css">
    </HEAD>
    <script language="JavaScript">
    <!--
    function checkForm (form){
    
    if (form.user.value.length < 5) {
    	alert("Il nome utente deve essere x lo meno di 5 caratteri")
        form.user.focus();
    	return false}
    
    if (form.passwd.value.length < 6) {
    	alert("La password deve essere x lo meno di 6 caratteri")
            form.passwd.focus();
    	return false}
    	
    }
    // -->
    </script>
    <BODY id=all bgColor=white leftMargin=0 topMargin=0 MARGINHEIGHT="0" MARGINWIDTH="0">
    <DIV align=center>
    
      <TABLE cellSpacing=0 cellPadding=0 width=766 border=0>
      <td>
          <TABLE cellSpacing=0 cellPadding=0 width=700 border=0>
            <TBODY>
              <TR>
                <TD></TD>
                <TD vAlign=top width=764>
                  <DIV align=center>
                    <TABLE width=764 border=0 class="unnamed1">
                      <TBODY>
                        <TR>
                          <TD align=left width=764 bgcolor="#e8e6e6">
    					<FORM name="form_ins" action="exec_add_ogg.php" method=post onsubmit="return checkForm(this)">
                              <TABLE cellSpacing=0 cellPadding=0 width="100%" 
                            align=center bgColor=#ffffff border=0>
                                <TBODY>
                                  <TR>
                                    <TD>
                                      <TABLE cellSpacing=1 cellPadding=4 width="100%" 
                                  border=0>
                                        <TBODY>
                                          <TR>
                                            <TD colSpan=3 class="cell_nav">Inserimento
                                              di un cliente in <font color="#FF0000">AREA
                                              RISERVATA CLIENTI</font></TD>
                                          </TR>
                                          <TR>
                                            <TD vAlign=top noWrap 
                                    bgColor=#e8e6e6><span class="unnamed1">Cliente:</span></TD>
                                            <TD width="37%" bgColor=#e8e6e6>
                                              <input name="user" type="text" class="unnamed1" id="caratteristiche" tabindex="1" value="" size="50">
    </TD>
                                            <TD width="52%" bgColor=#e8e6e6 class="unnamed1">(NON
                                                METTERE SPAZI NEL NOME CLIENTE, SE
                                              INSERITI VERRANNO AUTOMATICAMENTE RIMOSSSI
                                              DAL SISTEMA - MINIMO
                                              5 CARATTERI) </TD>
                                          </TR>
                                          <TR>
                                            <TD vAlign=top noWrap 
                                    bgColor=#e8e6e6 width="11%"><span class="unnamed1">Password:</span></TD>
                                            <TD bgColor=#e8e6e6>
                                              <input 
                                    name="passwd" type="password" class="unnamed1" id="passwd" tabIndex=2 size="50" 
                                    maxlength="255">
                                              </TD>
                                            <TD bgColor=#e8e6e6 class="unnamed1">(MINIMO
                                              6 CARATTERI) </TD>
                                          </TR>
                                          <TR>
                                            <TD vAlign=top noWrap 
                                    bgColor=#e8e6e6><span class="unnamed1">Email:</span></TD>
                                            <TD bgColor=#e8e6e6><input name="email" type="text" class="unnamed1" id="user" tabindex="3" value="" size="50"></TD>
                                            <TD bgColor=#e8e6e6 class="unnamed1">(FACOLTATIVA)</TD>
                                          </TR>
                                      </TABLE>
                                    </TD>
                                  </TR>
                              </TABLE>
                              
    
                              <TABLE cellSpacing=0 cellPadding=2 width="78%" 
                            align=center border=0>
                                <TBODY>
                                  <TR>
                                    <TD align=middle>
                                      <div align="right">
                                        <INPUT type=submit value="Inserisci" name=Submit2>
                                      </div>
                                    </TD>
                                  </TR>
                                </TBODY>
                              </TABLE>
                            </FORM>
                          </TD>
                        </TR>
                    </TABLE>
                  </DIV>
                </TD>
                <TD></TD>
              </TR>
              <TR>
                <TD></TD>
                <TD vAlign=top class="cell_nav_low" align="center"><a href="../index.php" class="unnamed1">Torna
                    al menu</a></TD>
                <TD></TD>
              </TR>
            </TBODY>
          </TABLE>
      </TABLE>
    </DIV>
    </BODY></HTML>
    Stega
    :-)

  2. #2
    Utente di HTML.it
    Registrato dal
    Dec 2001
    Messaggi
    3,259
    il nome del campo...

    nn puoi mettere user, devi cambiare

  3. #3
    nome riservato??

    Cmq adesso funziona, grazie 1000

    ciao
    Stega
    :-)

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.