Number of CheckBoxes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Galli

    #1

    Number of CheckBoxes

    Hi,

    In my Jsp, I have a huge number of checkbox with the same name.
    In IE 6.0, when I try to submit my form, I get a javascript "invalid
    syntax" error in the submit call.

    In Firefox this not happen.

    And I can't change the name of the checkbox.

    Thanks for any help,
    Galli
  • RobB

    #2
    Re: Number of CheckBoxes

    Galli wrote:[color=blue]
    > Hi,
    >
    > In my Jsp, I have a huge number of checkbox with the same name.
    > In IE 6.0, when I try to submit my form, I get a javascript "invalid
    > syntax" error in the submit call.
    >
    > In Firefox this not happen.
    >
    > And I can't change the name of the checkbox.
    >
    > Thanks for any help,
    > Galli[/color]

    If you're submitting with method="GET", try changing it to "POST".

    Otherwise, some more details (actually *any* details) might help....

    Comment

    • Lee

      #3
      Re: Number of CheckBoxes

      Galli said:[color=blue]
      >
      >Hi,
      >
      >In my Jsp, I have a huge number of checkbox with the same name.
      >In IE 6.0, when I try to submit my form, I get a javascript "invalid
      >syntax" error in the submit call.[/color]

      I've just tested with 10,000 checkboxes with no trouble in IE 6 or
      Firefox. What's a "huge number"? What does your submit invocation
      look like?

      Comment

      • Matt Kruse

        #4
        Re: Number of CheckBoxes

        Lee wrote:[color=blue]
        > I've just tested with 10,000 checkboxes with no trouble in IE 6 or
        > Firefox. What's a "huge number"? What does your submit invocation
        > look like?[/color]

        Did you check them all?

        When IE's URL length limit is reached, it gives cryptic error messages.

        If you have 10,000 checked controls, each with a value associated with it,
        and your form method=get, you should surely get an error.

        --
        Matt Kruse



        Comment

        • Galli

          #5
          Re: Number of CheckBoxes

          "Matt Kruse" <newsgroups@mat tkruse.com> wrote in message news:<d2s9et02m kn@news4.newsgu y.com>...[color=blue]
          > Lee wrote:[color=green]
          > > I've just tested with 10,000 checkboxes with no trouble in IE 6 or
          > > Firefox. What's a "huge number"? What does your submit invocation
          > > look like?[/color]
          >
          > Did you check them all?
          >
          > When IE's URL length limit is reached, it gives cryptic error messages.
          >
          > If you have 10,000 checked controls, each with a value associated with it,
          > and your form method=get, you should surely get an error.[/color]

          Hi All,

          Well, the huge number wasn't that "huge".
          The form doesn't have the method definition and when I put the
          method="POST" it worked fine.
          So I think the default in IE is GET.

          Thanks all for the help,
          Galli

          Comment

          • Grant Wagner

            #6
            Re: Number of CheckBoxes



            "Galli" <gallinho@gmail .com> wrote in message
            news:41f96237.0 504050404.5fd15 18@posting.goog le.com...[color=blue]
            > "Matt Kruse" <newsgroups@mat tkruse.com> wrote in message
            > news:<d2s9et02m kn@news4.newsgu y.com>...[color=green]
            >> Lee wrote:[color=darkred]
            >> > I've just tested with 10,000 checkboxes with no trouble in IE 6 or
            >> > Firefox. What's a "huge number"? What does your submit invocation
            >> > look like?[/color]
            >>
            >> Did you check them all?
            >>
            >> When IE's URL length limit is reached, it gives cryptic error
            >> messages.
            >>
            >> If you have 10,000 checked controls, each with a value associated
            >> with it,
            >> and your form method=get, you should surely get an error.[/color]
            >
            > Hi All,
            >
            > Well, the huge number wasn't that "huge".
            > The form doesn't have the method definition and when I put the
            > method="POST" it worked fine.
            > So I think the default in IE is GET.[/color]

            The default in all standards-conforming browsers is GET:

            <url: http://www.w3.org/TR/REC-html40/inte...ms.html#h-17.3 />

            The difference is that Gecko-based browsers don't appear to have trouble
            with URLs tens of thousands of characters long whereas Internet Explorer
            typically truncates the URL if it's greater than about 2000 characters,
            and in really extreme cases, such as yours, produces an error.

            --
            Grant Wagner <gwagner@agrico reunited.com>
            comp.lang.javas cript FAQ - http://jibbering.com/faq


            Comment

            • Matt Kruse

              #7
              Re: Number of CheckBoxes

              Grant Wagner wrote:[color=blue]
              > Internet Explorer typically truncates the URL if it's greater than
              > about 2000 characters, and in really extreme cases, such as yours,
              > produces an error.[/color]

              Can you create a test case where the URL is truncated?

              Any time the URL is too long for IE, I've always seen it generate a
              ridiculous error message that confuses everyone.

              --
              Matt Kruse



              Comment

              • Grant Wagner

                #8
                Re: Number of CheckBoxes

                "Matt Kruse" <newsgroups@mat tkruse.com> wrote in message
                news:d3218b0m63 @news4.newsguy. com...[color=blue]
                > Grant Wagner wrote:[color=green]
                >> Internet Explorer typically truncates the URL if it's greater than
                >> about 2000 characters, and in really extreme cases, such as yours,
                >> produces an error.[/color]
                >
                > Can you create a test case where the URL is truncated?
                >
                > Any time the URL is too long for IE, I've always seen it generate a
                > ridiculous error message that confuses everyone.[/color]

                It seems the behaviour has changed since the last time I tested this.
                Under Internet Explorer 6.0.2900 on my server the following code works
                in Internet Explorer, but the URL produced _appears_ to be:
                http://{server_name} Even though the original page loaded from
                http://{server_name}/dir1/dir2/longurl.htm and "X" is alerted.

                <script type="text/javascript">
                document.write( window.location .href.length);
                var search = window.location .search;
                if ('X' == search.charAt(s earch.length - 1))
                {
                alert(search.ch arAt(search.len gth - 1));
                }

                var s = (new Array(2023)).jo in('-');
                s += 'X';
                document.write( ';' + s.length);
                </script>
                <form method="GET" action="longurl .htm">
                <script type="text/javascript">
                document.write( '<input type="hidden" name="a" value="' + s + '">');
                </script>
                <input type="submit" value="Test">
                </form>
                <script type="text/javascript">
                document.write( '<a href="longurl.h tm?ts=' + (new Date()).getTime () +
                '">Reset</a>');
                </script>

                Other values around 2025 result in various URLs with strange unicode
                characters on them, but "X" still alerts. Changing the value in new
                Array() to something absurd like 10000 results in the form not
                submitting at all.

                --
                Grant Wagner <gwagner@agrico reunited.com>
                comp.lang.javas cript FAQ - http://jibbering.com/faq


                Comment

                • Thomas 'PointedEars' Lahn

                  #9
                  Re: Number of CheckBoxes

                  Galli wrote:
                  [color=blue]
                  > "Matt Kruse" <newsgroups@mat tkruse.com> wrote [...]_
                  > The form doesn't have the method definition and when I put the
                  > method="POST" it worked fine.
                  > So I think the default in IE is GET.[/color]

                  The default in all HTML 4+ UAs is `method="GET"', see the HTML 4.01
                  Specification.


                  PointedEars
                  --
                  Euer Ehren, zur Präventivexculp ation meines Mandanten:
                  Bereits prior zum Zeitpunkt der Kopulation hatte er aufgrund
                  intensiver sexueller Stimulation durch sekundär attraktive Objekte
                  effektiv eine maximal divergente psycho-soziale Konstitution. ;-)

                  Comment

                  Working...