Forum Moderators: open

Message Too Old, No Replies

Form target=self won't work in IE6

Javascript calling submit() with target frame

         

puttop

3:15 pm on Dec 2, 2006 (gmt 0)

10+ Year Member



I wrote the following code (snipped):
...
function DoSubMitThis(gal,nm,txt){
document.getElementById("naam").value=nm;
document.getElementById("text").value=txt;
document.getElementById("image").value=gal;
document.getElementById("show").submit();}

....
<body >
<form method="get" id="show" target='_self' action="./show.php">
<input type='hidden' name='naam' id='naam' value='SomeName'>
<input type='hidden' name='text' id='text' value='SomeText'>
<input type='hidden' name='image' id='image' value='SomeImage.jpg'>

</form>

...
<A href="javascript: void(0);"><img src='../small.jpg' onclick='DoSubMitThis("small.jpg","small","small.txt");'></A>
...

This will work in Opera, Netscape and Firefox, however not in IE6!
Changing the target to _blank will open a new window with the expected image in all browsers.
Why won't that _self target work under IE6, how to solve this?

puttop

penders

1:04 pm on Dec 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Do you need to specify a target at all if you are 'targeting' the same window/frame as the current document?

... and welcome to Webmaster World!

puttop

5:59 pm on Dec 3, 2006 (gmt 0)

10+ Year Member



It wont work without also.
It will work when I write:
<a href='show.php?image=Image.jpg=$nm&text=Sometext'><img src='Image.jpg' alt='Picture'></a>

So creating the Submit string myself, however the is not according to the HTML spec.

Arctic_Fox

8:44 pm on Dec 3, 2006 (gmt 0)

10+ Year Member



target="_self"

Arctic_Fox

8:45 pm on Dec 3, 2006 (gmt 0)

10+ Year Member



Or how about

target="_Top"

kaled

11:07 pm on Dec 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are single and double quotes interchangeable in HTML? All the html code I've ever seen uses double quotes.

Javascript isn't fussy provided the string begins and ends with the same kind of quote.

Kaled.

encyclo

11:31 pm on Dec 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are single and double quotes interchangeable in HTML?

You don't see single quotes used often in HTML, but both single and double quotes are perfectly valid.

Source: On SGML and HTML [w3.org] (W3C)

By default, SGML requires that all attribute values be delimited using either double quotation marks (ASCII decimal 34) or single quotation marks (ASCII decimal 39). Single quote marks can be included within the attribute value when the value is delimited by double quote marks, and vice versa.