DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: a form that doesn't submit

  1. #1
    guillermo Guest

    a form that doesn't submit


    i have a problem with the form, if Cuit_Ok returns true the message it's written
    but if it returns false the form doesn't submit, why?

    i didn't write Cuit_ok function but it's in the code of the asp page

    <script language="javascript">

    function Validar_CUIT (formulario){
    var nrodoc;
    nrodoc = document.form1.txt_nrodoc1.value + '-' +
    document.form1.txt_nrodoc2.value + '-' +
    document.form1.txt_nrodoc3.value;
    if (formulario==1){
    if (Cuit_ok (nrodoc)){
    document.form1.submit
    }
    else{
    alert ('CUIT Incorrecto');
    }
    }
    else{
    document.form2.submit;
    }
    }

    </SCRIPT>

    %>
    <body>
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <form ACTION="solo_bal.asp" METHOD="GET" name="form1">
    <%call Crear_Tabla ("Balances de clientes. Búsqueda por C.U.I.T.")%>
    </form>
    <center>
    <input TYPE="submit" value="BUSCAR" name="boton"
    ONCLICK="javascript:Validar_CUIT(1)">
    </center>
    <form ACTION="BUSCO_CLIENTE.ASP" METHOD="GET" name="form2">
    <input type="hidden" name="PAGINA" value="SOLO_bal">
    <%call Crear_Tabla ("Balances de clientes. Búsqueda por razón social.")%>
    </form>
    <center>
    <input TYPE="submit" value="BUSCAR" name="boton"
    ONCLICK="javascript:Validar_CUIT(2)">
    </center>
    </table>
    </body>

    Crear_Tabla it's a function that creates a table with some inputs

  2. #2
    Christ Guest

    Re: a form that doesn't submit


    You have to write the tag Input (<input TYPE="submit...) between the tags
    <Form ...> and </Form>

    "guillermo" <polonskyg@yahoo.com> wrote:
    >
    >i have a problem with the form, if Cuit_Ok returns true the message it's

    written
    >but if it returns false the form doesn't submit, why?
    >
    >i didn't write Cuit_ok function but it's in the code of the asp page
    >
    ><script language="javascript">
    >
    >function Validar_CUIT (formulario){
    > var nrodoc;
    > nrodoc = document.form1.txt_nrodoc1.value + '-' +
    > document.form1.txt_nrodoc2.value + '-' +
    > document.form1.txt_nrodoc3.value;
    > if (formulario==1){
    > if (Cuit_ok (nrodoc)){
    > document.form1.submit
    > }
    > else{
    > alert ('CUIT Incorrecto');
    > }
    > }
    > else{
    > document.form2.submit;
    > }
    >}
    >
    ></SCRIPT>
    >
    >%>
    ><body>
    ><table border="0" cellpadding="0" cellspacing="0" width="100%">
    > <form ACTION="solo_bal.asp" METHOD="GET" name="form1">
    > <%call Crear_Tabla ("Balances de clientes. Búsqueda por C.U.I.T.")%>
    > </form>
    > <center>
    > <input TYPE="submit" value="BUSCAR" name="boton"
    > ONCLICK="javascript:Validar_CUIT(1)">
    > </center>
    > <form ACTION="BUSCO_CLIENTE.ASP" METHOD="GET" name="form2">
    > <input type="hidden" name="PAGINA" value="SOLO_bal">
    > <%call Crear_Tabla ("Balances de clientes. Búsqueda por razón social.")%>
    > </form>
    > <center>
    > <input TYPE="submit" value="BUSCAR" name="boton"
    > ONCLICK="javascript:Validar_CUIT(2)">
    > </center>
    ></table>
    ></body>
    >
    >Crear_Tabla it's a function that creates a table with some inputs



  3. #3
    Craig Clearman Guest

    Re: a form that doesn't submit

    Guillermo,

    >i have a problem with the form, if Cuit_Ok returns true the message it's written
    >but if it returns false the form doesn't submit, why?


    > if (Cuit_ok (nrodoc)){
    > document.form1.submit
    > }
    > else{
    > alert ('CUIT Incorrecto');
    > }


    Seems that it would work the opposite. If cuit_ok returns non-zero, it
    should submit. If zero, it should show a message.

    That said, it looks good except for some formatting:

    document.form1.submit();

    I wouldn't have thought the parentheses and semi-colon would be
    necessary, but they may be.

    Ciao, Craig


  4. #4
    Rajesh Guest

    Re: a form that doesn't submit


    I think It should be
    document.form1.submit.click();
    INSTEAD OF ( Not a trigger of SQL but general ENGLISH LANG )
    document.form1.submit
    as submit is an object
    and click is one of the event bringing metod....
    Raj ( rajeshpmotwani@hotmail.com )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center