Navigate
Home
ArticleWiki
Forum
Newsletter
Links
Tech News
Welcome Guest.
Username:

Password:

Remember me

Need help opening input in thickbox
Welcome, Guest. Please login or register.
February 07, 2012, 07:01:19 AM
11513 Posts in 1262 Topics by 496 Members
Latest Member: Beerdernill
Experts Round Table Network  |  Clientside Technology  |  Javascript  |  Need help opening input in thickbox « previous next »
Pages: [1]
Author Topic: Need help opening input in thickbox  (Read 914 times)
Joleen73

Offline Offline

Posts: 5


« on: November 22, 2008, 02:16:16 AM »

Hello Folks,

I copied the story creator script from the javascript.internet dot com web site. The script works perfectly fine as is, currently once the user fills in their information and clicks create story the story is than shown below the inputs fields inside a textarea.

What I would like to do:
When the create story button is clicked have the story written into a div within a new page and open right away in Thickbox.

The entire script itself is rather long so I have upload it to Media Fire for viewing.
http://www.mediafire.com/?sharekey=1943c4576135f5abd2db6fb9a8902bda

If anyone could please show me how to accomplish this I would be eternally grateful.

Thank you,
Joleen
Logged
GrandSchtroumpf
Mentor

Offline Offline

Posts: 432



« Reply #1 on: November 28, 2008, 09:17:43 AM »

1. Use window.open() to open a window.
This returns a reference to your window.
http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

2. Use document.write() to write your code to that window.

That's all.

An alternate method to write your story to the new window is to use the DOM: create a DIV node and a TEXT node, add the TEXT to the DIV and the DIV to the BODY of your document.
Logged
GrandSchtroumpf
Mentor

Offline Offline

Posts: 432



« Reply #2 on: November 28, 2008, 01:20:25 PM »

Sorry, I don't think out of the box enough...
A much better solution is to submit the form to the "new page"... using something like <form action="process_story_form.php" target="story" method="get">
Then you build your story in the page "process_story_form.php", using some server-side scripting language (eg PHP).
If you cannot use server-side scripting, there are ways to do that on the client side in javascript, but it's a bad idea.
Logged
Pages: [1]
« previous next »
    Jump to: