open post in new window HELP!!

G

gregg

I have the folowing code implimented. when the post button is pressed
it places the info in the existing window. How can I make it open a
new window for the new data?

htp.p('<TD><A HREF=javascript:_SubmitForm("PARAMETER_FORM")><IMG
SRC="/sec/image/info.bmp" TARGET="_top" BORDER=0
ALIGN=ABSMIDDLE></A></TD>');

Sorry if there is not enough info. I am new at this.
 
D

DU

gregg said:
I have the folowing code implimented. when the post button is pressed
it places the info in the existing window. How can I make it open a
new window for the new data?

htp.p('<TD><A HREF=javascript:_SubmitForm("PARAMETER_FORM")><IMG
SRC="/sec/image/info.bmp" TARGET="_top" BORDER=0
ALIGN=ABSMIDDLE></A></TD>');

Sorry if there is not enough info. I am new at this.

This is item 4.37 covered by the comp.lang.javascript FAQ
In your code, img element can not have a target attribute. Also, you
should avoid using a href="javascript: construct which is known to be
bad, to create problems. This is again an item in the FAQ (4.24).

http://jibbering.com/faq/#FAQ4_37
http://jibbering.com/faq/#FAQ4_24

Finally, best is to give an url where we can examine the code of the
whole page.

DU
 
M

McKirahan

gregg said:
I have the folowing code implimented. when the post button is pressed
it places the info in the existing window. How can I make it open a
new window for the new data?

htp.p('<TD><A HREF=javascript:_SubmitForm("PARAMETER_FORM")><IMG
SRC="/sec/image/info.bmp" TARGET="_top" BORDER=0
ALIGN=ABSMIDDLE></A></TD>');

Sorry if there is not enough info. I am new at this.

Change
TARGET="_top"
to
TARGET="_blank"
 
M

McKirahan

DU said:
target attribute in an <img> element is invalid markup and can not be
rendered anyway.

DU

You're absolutely right. I saw the HREF tag and stopped thinking.

Try adding TARGET="_blank" inside the (unshown) <FORM> tag.

P.S. What good does TARGET="_top"inside the <IMG> tag do?
 
T

Thomas 'PointedEars' Lahn

gregg said:
I have the folowing code implimented. when the post button is pressed
it places the info in the existing window. How can I make it open a
new window for the new data?

Du not use
vvvvv
htp.p('<TD><A HREF=javascript:_SubmitForm("PARAMETER_FORM")><IMG
^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
but window.open(...). And that is utter nonsense.


PointedEars
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,147
Latest member
CarenSchni
Top