IE form.submit() proudces invalid syntax error

B

Bradley Kite

Hi all.

I'm trying to diagnose/solve a problem with internet explorer, whereby
sometimes the form submits, and other times IE produces an 'invalid
syntax' error.

First, I have a form, and within the form is a button bar and a <div>
block which contains a table of parameters. The div block is used to
create a layer.

Now, when the table contains 15 or less rows in it, any button on the
button
bar which calls form.submit() works as it should, however, where the
table has 16 or more rows, the form.submit generates an "invalid
syntax" error. IE doesnt provide any more detail on this error.

Mozilla/Netscape works as expected regardless of the number of rows.

I am using IE 6.0.2600.0000 but have also tried on other versions of
IE 6
and get the same results.

The code is as follows:


function _runButton()
{
document.getElementById('count_groups_form').submit();
}

<!-- Extra HTML removed -->

<form action="UpdateCount" method="get" id="count_groups_form"
enctype="application/x-www-form-urlencoded">
<input type="hidden" name="edit" value="0">
<input type="hidden" name="new_order" value="0">
<input type="hidden" name="action" value="">
<input type="hidden" name="has_changed" value="0">

<!-- Button Bar -->
<table class="button_bar" width="100%">
<tr>

<!-- other buttons removed -->

<td align="right" width="23%">
<input type="button" class="button" name="_run_button"
value="Run Count" onClick="_runButton();">
</td>
</tr>
</table>

<div align="left" class="count_groups" id="count_groups">
<table width="100%" class="without_border">

<!-- actual rows removed -->

</table>
</div>
</form>

Any help will be much appreciated.

Please reply to (e-mail address removed)
 
R

Randy Webb

Bradley said:
Hi all.

I'm trying to diagnose/solve a problem with internet explorer, whereby
sometimes the form submits, and other times IE produces an 'invalid
syntax' error.

I am using IE 6.0.2600.0000 but have also tried on other versions of
IE 6
and get the same results.

The code is as follows:


function _runButton()
{
document.getElementById('count_groups_form').submit();
document.forms['count_groups_form'].submit()


}

<!-- Extra HTML removed -->

<form action="UpdateCount" method="get" id="count_groups_form"
enctype="application/x-www-form-urlencoded">

<form NAME="count_groups_form".........>


Use the Forms NAME attribute along with the forms collection, test it,
and report back....

Please reply to (e-mail address removed)

No thanks. Ask in Usenet, get answered in Usenet. Read the group FAQ
with regards to such.
 
B

Brad

Tried that, and still no luck I'm afraid.

Its really strange that it works if there are 15 or less rows in the
table
(and therefore 15 or less <select> boxes), but 16 rows/<select> boxes
and
it doesnt?!?.

Could this be a bug in Internet Explorer??

Has any body else experienced similar problems?

I might try creating a new <form> (with hidden values) and have some
javascript copy all the values into it from the one that wont submit.
I'll let you know how I get on.

Regards
 
R

Randy Webb

Brad said:
Tried that, and still no luck I'm afraid.

Its really strange that it works if there are 15 or less rows in the
table
(and therefore 15 or less <select> boxes), but 16 rows/<select> boxes
and
it doesnt?!?.

Could this be a bug in Internet Explorer??

Has any body else experienced similar problems?

I might try creating a new <form> (with hidden values) and have some
javascript copy all the values into it from the one that wont submit.
I'll let you know how I get on.

Read the FAQ with regards to not quoting what you are replying to. This
is Usenet, not Email.

Post a URL to two pages. One with 15 "rows" and one with 16 "rows" so
that actual code can be tested.
 
M

montek

I realize this is a bit late, but the answer has to do with the length
of the request your form generates. Since MSIE only allows a limited
number of characters in a "GET" request, for long requests (i.e. many
fields), use a "POST" instead.

Bradley said:
Hi all.

I'm trying to diagnose/solve a problem with internet explorer, whereby
sometimes the form submits, and other times IE produces an 'invalid
syntax' error.

<snip>
 

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

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top