[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.0

Broken OnSubmit event

Asked by jpk in JavaScript

Tags: javascript

The following page completly ignores the onSubmit event in MSIE and Netscape. Can any one tell me how to fix it?


<html>
<head>
<title>TV VIRTUAL / CART 2001</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function formCheck() {

window.alert( "Entry point check!");

    var valid = true;
    // Check firstname:
   
    var name = document.myForm.firstname.value;

    if ( (document.myForm.firstname.length < 1) || (!isName( name )) ) {
        window.alert( "El nombre " + name= +"no es valido\n");
        valid = false;    }
   
    // Check lastname:
    var name = document.myForm.lastname.value;
    if ( (document.myForm.lastname.length < 1) || (!isName( name )) ) {
        window.alert( "El apellido " + name= +"no es valido\n");
        valid = false;
    }

    // Check street:
    var name = document.myForm.street.value;
    if ( (document.myForm.street.length < 1) || (!isName( name )) ) {
        window.alert( "La calle " + name= +"no es valida\n");
        valid = false;
    }
   
    // Check number:
    var name = document.myForm.Num.value;
    if ( (document.myForm.Num.length < 1) || (!isNumber( name )) ) {
        window.alert( "El número " + name= +"no es valido\n");
        valid = false;
    }

    // Check city:
    var name = document.myForm.city.value;
    if ( (document.myForm.city.length < 1)|| (!isName( name )) ) {
        window.alert( "La ciudad " + name= +"no es valida\n");
        valid = false;
    }
   
// Check country:
    var name = document.myForm.country.value;
    if ( (document.myForm.country.length < 1) || (!isName( name )) ) {
        window.alert( "El país " + name= +"no es valido\n");
        valid = false;
    }
   
// Check zip:
    var name = document.myForm.zip.value;
    if ( (document.myForm.zip.length < 1) || (!isNumber( name )) ) {
        window.alert( "El C.P. " + name= +"no es valido\n");
        valid = false;
    }
   
   
// Check mail:
    var name = document.myForm.mail.value;
    if ( !isMail( name ) ) {
        window.alert( "El correo " + name= +"no es valido\n");
        valid = false;
    }
   
// Check account:
    var name = document.myForm.account.value;
    if ( (document.myForm.account.length < 1) || (!isNumber( name )) ) {
        window.alert( "La clave " + name= +"no es valida\n");
        valid = false;
    }
   
    return valid;
}

function isName( str ) {
// solo letras y espacios
    var regexp = /^[a-zA-Z ]+$/;
    return regexp.test( str );
}

function isNumber( str ){

    var regexp = /^[a-ZA-Z0-9 ]+$/;
    return regexp.test( str );    
}

function isMail( str ){

    var regexp = /^.+\@.+\..+$/;
    return regexp.test( str );    
}


//-->
</script>
<noscript> <p><font color="#FF0066" size="8" face="Arial, Helvetica, sans-serif"> <font size="2">Por favor active JavaScript para utilizar esta página" </FONT></noscript>

</head>
<body bgcolor="#000066" background="../../../Paginas%20web/television%20virtual/PAGINA/fondo.jpg">
<div id="Layer1" style="position:absolute; width:82px; height:63px; z-index:1; left: 13px"><img src="logomain.jpg" width="92" height="84"></div>
<div id="Layer2" style="position:absolute; width:200px; height:21px; z-index:2; left: 9px; top: 96px"><img src="bluebar1.jpg" width="800" height="29"></div>
<div id="Layer3" style="position:absolute; width:129px; height:313px; z-index:3; left: 17px; top: 141px"><img src="remote.jpg" width="151" height="332" usemap="#Map" border="0"><map name="Map"><area shape="rect" coords="19,95,61,110" href="http://www.tvvirtual.com.mx/antros.html"><area shape="rect" coords="18,118,63,137" href="http://www.tvvirtual.com.mx/adrena.html"><area shape="rect" coords="17,142,62,161" href="http://www.tvvirtual.com.mx/7arte.html"><area shape="rect" coords="18,171,61,187" href="http://www.tvvirtual.com.mx/estilo.html"><area shape="rect" coords="16,195,63,213" href="http://www.tvvirtual.com.mx/solaren.html"><area shape="rect" coords="16,218,62,238" href="http://www.tvvirtual.com.mx/tvspot.html"><area shape="circle" coords="23,265,12" href="http://www.tvvirtual.com.mx/telenvivo.html"><area shape="circle" coords="63,263,11" href="http://www.tvvirtual.com.mx/ppv.html"><area shape="circle" coords="102,264,11" href="http://www.tvvirtual.com.mx/radio.html"><area shape="rect" coords="17,69,61,86" href="http://www.tvvirtual.com.mx/CART.html"></map></div>
<div id="Layer4" style="position:absolute; width:69px; height:18px; z-index:4; left: 94px; top: 471px"><img src="osxmain.jpg" width="85" height="37"></div>
<div id="Layer5" style="position:absolute; width:76px; height:26px; z-index:5; left: 8px; top: 471px"><a href="http://www.apple.com/quicktime"><img src="getqtmain.jpg" width="82" height="33" border="0"></a></div>
<div id="Layer6" style="position:absolute; width:106px; height:21px; z-index:6; left: 17px; top: 514px"><a href="http://www.tvvirtual.com.mx/comofunc.html"><img src="comofun.jpg" width="147" height="39" border="0"></a></div>
<div id="Layer7" style="position:absolute; width:74px; height:19px; z-index:7; left: 28px; top: 564px"><a href="http://www.tvvirtual.com.mx/contact.html"><img src="conta.jpg" width="120" height="44" border="0"></a></div>
<div id="Layer8" style="position:absolute; width:200px; height:19px; z-index:8; left: 192px; top: 132px"><img src="cuadro1.jpg" width="565" height="25"></div>
<div id="Layer9" style="position:absolute; width:16px; height:115px; z-index:9; left: 193px; top: 133px"><img src="cuadro2.jpg" width="20" height="465"></div>
<div id="Layer10" style="position:absolute; width:17px; height:115px; z-index:10; left: 738px; top: 132px"><img src="cuadro3.jpg" width="19" height="469"></div>
<div id="Layer11" style="position:absolute; width:200px; height:11px; z-index:11; left: 192px; top: 580px"><img src="cuadro4.jpg" width="566" height="17"></div>
<div id="Layer13" style="position:absolute; width:47px; height:52px; z-index:13; left: 763px; top: 175px"><a href="http://www.tvvirtual.com.mx/noticias.html"><img src="noticias.jpg" width="61" height="68" border="0"></a></div>
<div id="Layer15" style="position:absolute; width:58px; height:48px; z-index:15; left: 765px; top: 257px"><a href="http://chat.tvvirtual.com.mx"><img src="cartchat.jpg" width="58" height="85" border="0"></a></div>
<div id="Layer14" style="position:absolute; width:200px; height:45px; z-index:14; left: 112px; top: 10px"><img src="bannercart.jpg" width="616" height="83" border="0"></div>
<div id="Layer22" style="position:absolute; width:408px; height:314px; z-index:22; left: 203px; top: 157px"><img src="CARTFONDO2.jpg" width="533" height="426"></div>
<div id="Layer24" style="position:absolute; width:200px; height:115px; z-index:24; left: 339px; top: 231px"></div>
<div id="Layer16" style="position:absolute; left:204px; top:211px; width:544px; height:115px; z-index:26; visibility:visible; overflow: visible">
 
   <form method="post" onSubmit="if (form_check()) { return true } else { return false }" action="userregister.jsp" name="registro">
    <p><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"> <font size="2">Nombre
      : </font> <font size="2"> </font><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><font size="2">
      </font><font color="#FFFFFF"><font color="#FF0066">*</font></font><font size="2">
      <input type="text" name="firstname" size="15" maxlength="40">
      </font><font size="2" color="#FFFFFF">Apellidos: </font><font color="#FFFFFF"><font color="#FF0066">*</font></font><font size="2" color="#FFFFFF">
      <input type="text" name="lastname" size="15" maxlength="80">
      </font></font></font></p>
    <p><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Fecha
      de Nacimiento:</font> <font size="2">
      <select name="day" size="1">
        <option>1</option>
        <option>2</option>
        <option>3</option>
        <option>4</option>
        <option>5</option>
        <option>6</option>
        <option>7</option>
        <option>8</option>
        <option>9</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 name="Month" size="1">
        <option>Enero</option>
        <option>Febrero</option>
        <option>Marzo</option>
        <option>Abril</option>
        <option>Mayo</option>
        <option>Junio</option>
        <option>Julio</option>
        <option>Agosto</option>
        <option>Septiembre</option>
        <option>Octubre</option>
        <option>Noviembre</option>
        <option>Diciembre</option>
      </select>
      <select name="year" size="1">
        <option>1994</option>
        <option>1993</option>
        <option>1992</option>
        <option>1991</option>
        <option>1990</option>
        <option>1989</option>
        <option>1988</option>
        <option>1987</option>
        <option>1986</option>
        <option>1985</option>
        <option>1984</option>
        <option>1983</option>
        <option>1982</option>
        <option>1981</option>
        <option>1980</option>
        <option>1979</option>
        <option>1978</option>
        <option>1977</option>
        <option>1976</option>
        <option>1975</option>
        <option>1974</option>
        <option>1973</option>
        <option>1972</option>
        <option>1971</option>
        <option>1970</option>
        <option>1969</option>
        <option>1968</option>
        <option>1967</option>
        <option>1966</option>
        <option>1965</option>
        <option>1964</option>
        <option>1963</option>
        <option>1962</option>
        <option>1961</option>
        <option>1960</option>
        <option>1959</option>
        <option>1958</option>
        <option>1957</option>
        <option>1956</option>
        <option>1955</option>
        <option>1954</option>
        <option>1953</option>
        <option>1952</option>
        <option>1951</option>
        <option>1950</option>
        <option>1949</option>
        <option>1948</option>
        <option>1947</option>
        <option>1946</option>
        <option>1945</option>
        <option>1944</option>
        <option>1943</option>
        <option>1942</option>
        <option>1941</option>
        <option>1940</option>
        <option>Antes</option>
      </select>
      </font><font size="2" color="#FFFFFF">Sexo:
      <select name="sex" size="1">
        <option value="M" selected>Masculino</option>
        <option value="F">Femenino</option>
      </select>
      </font></p>
    <p><font size="2" color="#FFFFFF">Calle: </font><font color="#FFFFFF"><font color="#FF0066">*</font></font><font size="2" color="#FFFFFF">
      <input type="text" name="street" size="20">
      N&uacute;mero: </font><font color="#FFFFFF"><font color="#FF0066">*</font></font><font size="2" color="#FFFFFF">
      <input type="text" name="Num" size="10">
      </font></p>
    <p><font size="2" color="#FFFFFF">Ciudad: </font><font color="#FFFFFF"><font color="#FF0066">*</font></font><font size="2" color="#FFFFFF">
      <input type="text" name="city" size="10" maxlength="40">
      Estado:</font><font color="#FFFFFF"><font color="#FF0066">*</font></font><font size="2" color="#FFFFFF">
      <input type="text" name="state" size="10" maxlength="10">
      Pa&iacute;s: </font><font color="#FFFFFF"><font color="#FF0066">*</font></font><font size="2" color="#FFFFFF">
      <input type="text" name="country" size="10" maxlength="15">
      </font></p>
    <p><font size="2" color="#FFFFFF">C.P.</font><font color="#FFFFFF"><font color="#FF0066">*</font></font><font size="2" color="#FFFFFF">
      <input type="text" name="zip" size="10" maxlength="15">
      </font><font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="2">Tel&eacute;fono
      <input type="text" name="telefono" size="10" maxlength="20">
      . Mail </font><font color="#FFFFFF"><font color="#FF0066">*</font></font><font color="#FFFFFF" face="Arial, Helvetica, sans-serif" size="2">
      <input type="text" name="mail" size="10" maxlength="40">
      </font></p>
    <p><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Clave
      confidencial que quieres:</font><font color="#FFFFFF"><font color="#FF0066">*</font></font><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">
      <input type="text" name="account" size="10" maxlength="20">
      </font></p>
    <p><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">Deseas
      recibir correos electr&oacute;nicos con informaci&oacute;n adicional? </font><font color="#FFFFFF"><font color="#FF0066">*</font></font><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">
      <select name="news">
        <option value="true" selected>Si</option>
        <option value="false">No</option>
      </select>
      </font></p>
    <p><font color="#FFFFFF">Los campos que se indican con un <font color="#FF0066">*</font>
      rojo son obligatorios.</font><font size="2" color="#FFFFFF">
      <input type="submit" name="Submit" value="Enviar">
      </font></p>
  </form>
</div>
</body>
</html>
[+][-]02/26/01 08:03 AM, ID: 5879664Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: JavaScript
Tags: javascript
Sign Up Now!
Solution Provided By: CJ_S
Participating Experts: 2
Solution Grade: A
 
[+][-]02/26/01 07:54 AM, ID: 5879638Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/26/01 07:55 AM, ID: 5879642Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/26/01 08:29 AM, ID: 5879772Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/26/01 08:30 AM, ID: 5879775Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/26/01 11:31 AM, ID: 5880483Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/26/01 11:49 PM, ID: 5882339Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92