Size limit for submit using post ?

Discussion in 'Javascript' started by Gerard Cany, Nov 2, 2003.

  1. Gerard Cany

    Gerard Cany Guest

    I have a problem with a javascript that seems related to the number/size of
    parameters sent by the form
    The method for the form is POST (not GET, I know the size limit with
    GET)
    The symptom : some times, I receive a javascript error "Invalid syntax
    on line xxx", this line contains the call to submit as shown in the
    following lines :

    <input type="button"
    value="<%=Session("Bouton_EnregistrerFicheInclusion")%>"
    style="{width:100%}"
    onclick="AfficherTousOnglets(); if
    (form_check()){document.forms[0].submit(); }"
    name="Validation">

    To debug that, I inserted an alert("hello") just before the
    document.forms[0].submit(); the alert message was OK, but
    the "invalid syntax" on the submit was still there.
    I also tried to change document.forms[0] to document.form1 (the name of
    the form) and document.getelementById
    The number of input fields for this form is around 250
    The problem does not appear when few fields are filled.
    I could not find any information on a size limit with the POST method

    The navigator is IE6. The page is to complex for Netscape.
    With FireBird no problem : everything work fine

    Any ideas ?
    Thank for your answer

    GĂ©rard Cany

    Rapsodie

    Batiment T4

    Parc Technologique de la Pompignane

    34 055 Montpellier Cedex 1

    tel : 04 67 13 82 05
    fax : 04 67 99 05 63
    mobile : 06 07 97 64 13
    E-mail :
     
    Gerard Cany, Nov 2, 2003
    #1
    1. Advertising

  2. Gerard Cany

    VK Guest

    > ... value="<%=Session("Bouton_EnregistrerFicheInclusion")%>" style=...

    Try to split this line apart based on quotes only (this is exactly how
    JavaScript interpreter does):

    Option 1:
    ....value="[string
    begins]<%=Session("Bouton_EnregistrerFicheInclusion")%>"[string ends]...
    Option 2:
    ....value="[string begins]<%=Session("[string
    ends]Bouton_EnregistrerFicheInclusion"[string begins])%>"[string ends]
    Also options 3, 4, x...
    What option will be selected next time, depends on unpredictable
    fluctuations inside the interpreter.

    This is why NEVER USE THE SAME TYPE OF QUOTES TO DELIMIT A STRING AND
    INSIDE THAT STRING (print it out and attach to the monitor :)

    Solution 1 (escaping quotes inside the string)
    ....value="<%=Session(\"Bouton_EnregistrerFicheInclusion\")%>"...

    Solution 2 (the best, using different types of quotes):
    ....value='<%=Session("Bouton_EnregistrerFicheInclusion")%>'... or
    ....value="<%=Session('Bouton_EnregistrerFicheInclusion')%>"...

    P.S. Post method has no built-in transfer limitations: 1MB, 100MB or the
    entire Web. But usually there are some reasonable limits set on the
    server-side.
     
    VK, Nov 2, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DiscoStu
    Replies:
    6
    Views:
    13,804
  2. news.amnet.net.au
    Replies:
    1
    Views:
    991
    Sudsy
    Sep 15, 2004
  3. news.amnet.net.au

    Limit to size of POST in forms?

    news.amnet.net.au, Sep 10, 2004, in forum: HTML
    Replies:
    2
    Views:
    576
    Isofarro
    Sep 10, 2004
  4. news.amnet.net.au

    Limit to size of POST in forms

    news.amnet.net.au, Sep 10, 2004, in forum: HTML
    Replies:
    0
    Views:
    509
    news.amnet.net.au
    Sep 10, 2004
  5. Replies:
    1
    Views:
    1,142
    Victor Bazarov
    Jun 28, 2005
Loading...

Share This Page