By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,818 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,818 IT Pros & Developers. It's quick & easy.

IE form.submit() proudces invalid syntax error

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.