Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text open a window

Status
Not open for further replies.

sirron

Programmer
Mar 11, 2004
139
US
I have TEXT on a page, and I want to click the text to open a window page that is set to a size like width=400 height=400

Is there a way to do this.

I tried to use a javascript like this:

function FaqWindow() {
window.open('HR-FAQ.asp','Frequently Asked Question','width=300,
height=300,scrollbars=no,statusbar=no,toolbar=no,resizable=no');
}
window.onload = FaqWindow;
//-->
</script>

if this works I do I set this to the text:

<p align="left"><strong><font color="#0000FF"><u>Where do I begin?</u></font></strong></p>

thanks in advance
 
If you want the user to click "text" on page1, which opens page2, then use an anchor tag:

<p align="left"><strong><font color="#0000FF"><u><a href="JavaScript:FaqWindow">Where do I begin?</a></u></font></strong></p>

If, on the other hand, you are asking "How do I open a window, and then write text into the new window", you would use the "write()" method. If you give the window the name "FAQ", then you would do:

FAQ.write("This text will appear in the new window."); FAQ.close();



Thomas D. Greer

Providing PostScript & PDF
Training, Development & Consulting
 
So I can't use what I have?
I have seen some examples of what I'm trying to do. But I don't know how to set the function to the TEXT.

Is there a way to do it with the function?
 
Is this what you're looking for?
Code:
<p align="left" [red]onclick="FaqWindow();"[/red]><strong><font color="#0000FF"><u>Where do I begin?</u></font></strong></p>

--Chessbot

"Violence is the last refuge of the incompetent." -- Asimov, Foundation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top