Guest Miqueiasfer Postado Maio 25, 2008 Denunciar Share Postado Maio 25, 2008 Pessoal alguém pode me dizer o porque o onsubmit não está executando o alert?<html> <head> <title>BIBLIONET</title> <script language="JavaScript"> <!-- function FP_preloadImgs() {//v1.0 var d=document,a=arguments; if(!d.FP_imgs) d.FP_imgs=new Array(); for(var i=0; i<a.length; i++) { d.FP_imgs[i]=new Image; d.FP_imgs[i].src=a[i]; } } [b]function validate(){ if (document.form.txtSenha.value=="") { alert("O Campo Senha não está preenchido!") return false } if (document.form.txtConfSen.value=="") { alert("O Campo Confirmar Senha não está preenchido!") return false } if(document.form.txtSenha.value != document.form.txtConfSen.value) { alert("O campo Confirmar Senha está errado, verifque!"); return false; } return true }[/b]// --> </script> </head> <body bgcolor="#D8E3AE" onload="FP_preloadImgs(/*url*/'button2C.jpg', /*url*/'button2D.jpg')"> <div align="center"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#FFFFFF" width="656" id="AutoNumber1" height="357"> <tr> <td width="86%" height="150" bordercolor="#FFFFFF" style="border-bottom-style: solid; border-bottom-width: 1"> <img border="0" src="images/BannerBiblio.gif" width="656" height="150"></td> </tr> <tr> <td width="86%" height="184" bgcolor="#FFFFFF" align="center"> <form method="POST" action="exemplo.php" name="form"> <!--webbot bot="SaveResults" u-file="fpweb:///_private/form_results.csv" s-format="TEXT/CSV" s-label-fields="TRUE" --><p> </p> <p> </p> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#FFFFFF" width="100%" id="AutoNumber3"> <tr> <td width="100%" align="center" bordercolor="#FFFFFF"> <fieldset style="border:1px solid #B1C95D; width: 615; height: 41; padding: 2"> <legend align="center"> <font face="Comic Sans MS" color="#55671D" style="font-size: 14pt"> Cadastro de Usuários</font></legend> <p style="margin-top: 0; margin-bottom: 0" align="center"> <p style="margin-top: 0; margin-bottom: 0" align="center"> </p> <p style="margin-top: 0; margin-bottom: 0" align="center"> <font face="Comic Sans MS" color="#55671D" size="3">Dados Pessoais</font></p> <p style="margin-top: 0; margin-bottom: 0" align="center"> </p> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#B1C95D" width="90%" id="AutoNumber4" height="200"> <tr> <td width="21%" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium" height="13"> </td> <td width="49%" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium" height="13"> </td> </tr> <tr> <td width="21%" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28"> <font face="Comic Sans MS" color="#55671D" style="font-size: 10pt"> Nome:</font></td> <td width="49%" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28"> <input type="text" name="txtNome" size="49"></td> </tr> <tr> <td width="21%" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28"> <font face="Comic Sans MS" style="font-size: 10pt" color="#55671D"> Sexo:</font></td> <td width="49%" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28"> <input type="radio" value="M" checked name="R1">Masculino <input type="radio" name="R1" value="F">Feminino</td> </tr> <tr> <td width="21%" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28"> <font face="Comic Sans MS" style="font-size: 10pt" color="#55671D"> Data Nascimento:</font></td> <td width="49%" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28"> <select size="1" name="csdia"> <option>01</option> <option>02</option> <option>03</option> <option>04</option> <option>05</option> <option>06</option> <option>07</option> <option>08</option> <option>09</option> <option>10</option> <option>11</option> <option>12</option> <option>13</option> <option>14</option> <option>15</option> <option>16</option> <option>17</option> <option>18</option> <option>19</option> <option>20</option> <option>21</option> <option>22</option> <option>23</option> <option>24</option> <option>25</option> <option>26</option> <option>27</option> <option>28</option> <option>29</option> <option>30</option> <option>31</option> </select> <select size="1" name="csmes"> <option>01</option> <option>02</option> <option>03</option> <option>04</option> <option>05</option> <option>06</option> <option>07</option> <option>08</option> <option>09</option> <option>10</option> <option>11</option> <option>12</option> </select> <select size="1" name="csano"> <option>1980</option> <option>1981</option> <option>1982</option> <option>1983</option> <option>1984</option> <option>1985</option> <option>1986</option> <option>1987</option> <option>1988</option> <option>1989</option> <option>1990</option> <option>1991</option> <option>1992</option> <option>1993</option> <option>1994</option> <option>1995</option> <option>1996</option> <option>1997</option> <option>1998</option> <option>1999</option> <option>2000</option> <option>2001</option> <option>2002</option> <option>2003</option> <option>2004</option> <option>2005</option> <option>2006</option> <option>2007</option> <option>2008</option> <option>2009</option> <option>2010</option> </select> </td> </tr> <tr> <td width="21%" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28"> <font face="Comic Sans MS" size="2" color="#55671D">Grau de Escolaridade:</font></td> <td width="49%" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28"> <select size="1" name="csGrauEscol"> <option selected>Escolher</option> <option>1° Grau Incompleto</option> <option>1° Grau Completo</option> <option>2° Grau Incompleto</option> <option>2° Grau Completo</option> <option>3° Grau incompleto</option> <option>Nível Superior</option> <option>Outros</option> </select></td> </tr> <tr> <td width="21%" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28"> <font face="Comic Sans MS" size="2" color="#55671D">Cidade de Residência:</font></td> <td width="49%" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" height="28"> <input type="text" name="txtCidResid" size="20"><font size="2" face="Comic Sans MS" color="#6A8224"> </font><font size="2" face="Comic Sans MS" color="#55671D">UF:</font><select size="1" name="csUF" > <option selected>Selecione</option> <option>AC</option> <option>AL</option> <option>AM</option> <option>AP</option> <option>BA</option> <option>CE</option> <option>DF</option> <option>ES</option> <option>GO</option> <option>MA</option> <option>MG</option> <option>MS</option> <option>muito</option> <option>PA</option> <option>PB</option> <option>PE</option> <option>PI</option> <option>PR</option> <option>RJ</option> <option>RN</option> <option>RO</option> <option>RR</option> <option>RS</option> <option>SC</option> <option>SE</option> <option>SP</option> <option>TO</option> </select></td> </td> </tr> <tr> <td width="21%" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1" height="28"> <font face="Comic Sans MS" size="2" color="#55671D">E-mail:</font></td> <td width="49%" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1" height="28"> <input type="text" name="txtE_mail" size="49"></td> </tr> </table> <p style="margin-top: 0; margin-bottom: 0"> <font face="Comic Sans MS" size="2" color="#6A8224"> </font></p> <p style="margin-top: 0; margin-bottom: 0"> </p> <p style="margin-top: 0; margin-bottom: 0"> </p> <p style="margin-top: 0; margin-bottom: 0" align="center"><font color="#55671D" size="3" face="Comic Sans MS"> Cadastro de Senha de Acesso</font></p> <p style="margin-top: 0; margin-bottom: 0"> </p> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#B1C95D" width="90%" id="table1" height="68"> <tr> <td width="30%" height="13" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium"> </td> <td width="70%" height="13" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: solid; border-top-width: 1; border-bottom-style: none; border-bottom-width: medium"> </td> </tr> <tr> <td width="30%" height="28" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium"> <font size="2" face="Comic Sans MS" color="#55671D">Login:</font></td> <td width="70%" height="28" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium"> <input type="text" name="txtLogin" size="20"></td> </tr> <tr> <td width="30%" height="28" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium"> <font face="Comic Sans MS" color="#55671D" size="2">Senha:</font></td> <td width="70%" height="28" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium"> <input type="password" name="txtSenha" size="20"></td> </tr> <tr> <td width="30%" height="28" style="border-left-style: solid; border-left-width: 1; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1"> <font face="Comic Sans MS" size="2" color="#55671D">Confirmar Senha:</font></td> <td width="70%" height="28" style="border-left-style: none; border-left-width: medium; border-right-style: solid; border-right-width: 1; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1"> <input type="password" name="txtConfSen" size="20"></td> </tr> </table> <p style="margin-top: 0; margin-bottom: 0" align="left"> </p> <p style="margin-top: 0; margin-bottom: 0"> </p> <p style="margin-top: 0; margin-bottom: 0"> </p> <p style="margin-top: 0; margin-bottom: 0"> </p> <p style="margin-top: 0; margin-bottom: 0" align="center"> [b]<input type="submit" value="Enviar" onsumit="java script:validate()">[/b] </a></p> <p> </p> </fieldset></td> </tr> </table> </form> <p align="center"> </td> </tr> </table> </div> </body> </html> Citar Link para o comentário Compartilhar em outros sites More sharing options...
0 fercosmig Postado Maio 26, 2008 Denunciar Share Postado Maio 26, 2008 porque o onsubmit deve ser colocado no formex:<form method="POST" action="exemplo.php" name="form" onsumit="java script: return validate();"> Citar Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Guest Miqueiasfer
Pessoal alguém pode me dizer o porque o onsubmit não está executando o alert?
Link para o comentário
Compartilhar em outros sites
1 resposta a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.