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

What is wrong with "form"

P: n/a
On my testpage

http://www.sonoptikon.de/test.php

I have this

<table><tr>

<td valign="top" align="center" style="width:150px;">
<form action=test.php method="get">
<input style="width:150px;" type="Submit" value="Provisionsentwicklung">
<input type="hidden" name="mode" value="pr"
</form>
</td>

<td valign="top" align="center" style="width:150px;">
<form action=test.php method="get">
<input style="width:150px;" type="Submit" value="IP-Entwicklung">
<input type="hidden" name="mode" value="ip"
</form>
</td>

</tr></table>

If I klick on any button, I get

"http://www.sonoptikon.de/test.php?mode=pr&mode=ip"

What is wrong?

Source text is:

print '
<td valign="top" align="center" style="width:150px;">
<form action=' . $HTTP_SERVER_VARS['PHP_SELF'] . ' method="get">
<input style="width:150px;" type="Submit" value="Provisionsentwicklung">
<input type="hidden" name="mode" value="pr"
</form>
</td>

<td valign="top" align="center" style="width:150px;">
<form action=' . $HTTP_SERVER_VARS['PHP_SELF'] . ' method="get">
<input style="width:150px;" type="Submit" value="IP-Entwicklung">
<input type="hidden" name="mode" value="ip"
</form>
</td>';

It works correct with mozilla, you can see this error only in IE

Thanks for help

Werner

--
--------------------------------------------------
Werner Partner, 45699 Herten
http://www.sonoptikon.de
Jul 24 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Werner Partner <ka****@sonoptikon.de> wrote:
On my testpage

http://www.sonoptikon.de/test.php

<form action=test.php method="get">
<input style="width:150px;" type="Submit" value="Provisionsentwicklung">
<input type="hidden" name="mode" value="pr"
</form>
The hidden input tag is missing the > at the end.
So the browser may treat
<input type="hidden" name="mode" value="pr"</form>
as one tag and hence doesn't close the first form.
<form action=test.php method="get">
<input style="width:150px;" type="Submit" value="IP-Entwicklung">
<input type="hidden" name="mode" value="ip"
</form>
Again the form isn't closed but that's irrelevant now as you have no
more forms in the page.
If I klick on any button, I get

"http://www.sonoptikon.de/test.php?mode=pr&mode=ip"

What is wrong?
What you effectively have is:

<form action=test.php method="get">
<input style="width:150px;" type="Submit"
value="Provisionsentwicklung">
<input type="hidden" name="mode" value="pr">
<input style="width:150px;" type="Submit" value="IP-Entwicklung">
<input type="hidden" name="mode" value="ip">

and the submitted result is correct for that.
It works correct with mozilla, you can see this error only in IE


For once Mozilla's error correction is kinder to mistakes than IE's.

Running your code through the validator would have pointed out this
mistake (and some others).

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 24 '05 #2

P: n/a
Steve Pugh schrieb:
Werner Partner <ka****@sonoptikon.de> wrote:

On my testpage

http://www.sonoptikon.de/test.php

<form action=test.php method="get">
<input style="width:150px;" type="Submit" value="Provisionsentwicklung">
<input type="hidden" name="mode" value="pr"
</form>

The hidden input tag is missing the > at the end.
So the browser may treat
<input type="hidden" name="mode" value="pr"</form>
as one tag and hence doesn't close the first form.


Uff - that happens when I am looking for "serious" mistake and not
seeing the simple mistakes

By the way - what about </input> ?

Thanks

Werner


--
--------------------------------------------------
Werner Partner, 45699 Herten
http://www.sonoptikon.de
Jul 24 '05 #3

P: n/a
On 31/03/2005 11:37, Werner Partner wrote:

[snip]
By the way - what about </input> ?


INPUT elements are empty: they have no content so they don't need
closing tags. In fact, closing INPUT tags are forbidden in HTML.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 24 '05 #4

P: n/a
Werner Partner <ka****@sonoptikon.de> wrote:
By the way - what about </input> ?


Allowed but not recommended in XHTML (though not allowed in
HTML-compatible XHTML). No such thing in HTML.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 24 '05 #5

P: n/a
Steve Pugh wrote:
Werner Partner <ka****@sonoptikon.de> wrote:

By the way - what about </input> ?

Allowed but not recommended in XHTML


Not recommended, but the opening tag must end in /> otherwise.

(though not allowed in HTML-compatible XHTML). No such thing in HTML.

Steve

Jul 24 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.