document.form.submit() doesn't work for large form fields

Discussion in 'Javascript' started by alan_atwood, Mar 2, 2006.

  1. alan_atwood

    alan_atwood Guest

    Hello all. I am having a problem with the submit() method that is
    driving me nuts. I'm using document.form.submit() with large text
    fields (approx. 2000 characters) and am getting a "Invalid Syntax"
    error. If I do the same thing with a text field of under 1500
    characters, it works fine.

    Is there some size limit here that I don't know about? Haven't been
    able to find anything so far on this particular problem.

    Thanks,
    Alan
     
    alan_atwood, Mar 2, 2006
    #1
    1. Advertising

  2. alan_atwood

    Matt Kruse Guest

    alan_atwood wrote:
    > Hello all. I am having a problem with the submit() method that is
    > driving me nuts. I'm using document.form.submit() with large text
    > fields (approx. 2000 characters) and am getting a "Invalid Syntax"
    > error. If I do the same thing with a text field of under 1500
    > characters, it works fine.
    > Is there some size limit here that I don't know about? Haven't been
    > able to find anything so far on this particular problem.


    Your form probably has method="get" which has a size limit in different
    browsers. This problem would exist even if you used a submit button and no
    javascript.
    Use method="post" instead.

    --
    Matt Kruse
    http://www.JavascriptToolbox.com
    http://www.AjaxToolbox.com
     
    Matt Kruse, Mar 2, 2006
    #2
    1. Advertising

  3. alan_atwood

    VK Guest

    alan_atwood wrote:
    > Hello all. I am having a problem with the submit() method that is
    > driving me nuts. I'm using document.form.submit() with large text
    > fields (approx. 2000 characters) and am getting a "Invalid Syntax"
    > error. If I do the same thing with a text field of under 1500
    > characters, it works fine.
    >
    > Is there some size limit here that I don't know about? Haven't been
    > able to find anything so far on this particular problem.


    Are you using GET or POST in your form?

    In what browser are you seeing the error?
     
    VK, Mar 2, 2006
    #3
    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. The Crow
    Replies:
    2
    Views:
    4,424
    Bruce Barker
    Sep 27, 2005
  2. Curious89
    Replies:
    0
    Views:
    931
    Curious89
    Feb 20, 2010
  3. Harry
    Replies:
    3
    Views:
    380
    Harry
    Jan 12, 2006
  4. Edward
    Replies:
    1
    Views:
    148
    Lasse Reichstein Nielsen
    Jan 4, 2004
  5. Replies:
    3
    Views:
    726
Loading...

Share This Page