471,092 Members | 1,056 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

IE form.submit() proudces invalid syntax error

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').submi t();
}

<!-- 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 ki****@alchemetrics.co.uk
Jul 23 '05 #1
4 10503
Bradley Kite wrote:
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-->
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').submi t();
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....

<--snip-->

Please reply to ki****@alchemetrics.co.uk


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

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
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
--
Brad

Jul 23 '05 #3
Brad wrote:
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #4
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 Kite wrote:
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>

Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by dave | last post: by
1 post views Thread by Cooper | last post: by
10 posts views Thread by Steve Benson | last post: by
18 posts views Thread by lawrence | last post: by
4 posts views Thread by Stuart Perryman | last post: by
5 posts views Thread by Navillus | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.