Number of CheckBoxes

G

Galli

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
 
R

RobB

Galli said:
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

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

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

Lee

Galli said:
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.

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?
 
M

Matt Kruse

Lee said:
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?

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.
 
G

Galli

Matt Kruse said:
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.

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
 
G

Grant Wagner

Galli said:
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.

The default in all standards-conforming browsers is GET:

<url: http://www.w3.org/TR/REC-html40/interact/forms.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.
 
M

Matt Kruse

Grant said:
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.

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.
 
G

Grant Wagner

Matt Kruse said:
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.

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(search.length - 1))
{
alert(search.charAt(search.length - 1));
}

var s = (new Array(2023)).join('-');
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.htm?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.
 
T

Thomas 'PointedEars' Lahn

Galli said:
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.

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


PointedEars
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top