Click to See Complete Forum and Search --> : separate popup to select content for separate page.


erick
08-18-2003, 10:42 PM
Hello All,

Can anyone please point me in the right direction for some javascript code..

On a primary html page I want to be able to fillin the contents of a <textarea> by a button that when opened opens a little separate window that will have different chioices in it, Select a choice and that choice is put into the <textarea> of the primary page then the choice window closes itself..

Any help would be most appriciated.

Thank you
Erick

CSW800
08-19-2003, 12:39 AM
The window you open could be an HTML Dialog box.

On the main page, where you have the button try adding this to the onclick code:


document.theform.thetextarea = showModalDialog("filename.html", "", "dialogHeight:100px; dialogWidth:100px; scroll:off; status:no;");


showModalDialog() is similar to window.open(). I suppose to make modeless dialog box you could use showDialog, but I'm not sure.

In filename.html, the button or whatever you use to close the dialog box put this in the onclick code:


returnValue=thevalue;


where thevalue is what you want in the textarea....

I'm not sure if a dialog box will work in any other browser except for IE, so I suppose someone else will be able to come up with a better answer than me.