Hi,
Don W. wrote:
Thank you for taking the time to provide me with all that information!
I may not have been clear in my question. If I open a window from a script
using something like this:
window.open("user_input.htm") from within a script, then how can I retrieve
the data from a form in user_input.htm?
The only way I can find to do this is to open a file in user_input.htm and
write the data to the file. I still need some way for the script to know
when to read the file.
You couldn't do this anyway, since client-side JavaScript is not allowed
to write files, unless in certains special security conditions, and in
very specific (not cross-browser) ways.
I don't like using this intermediate file. Do you know a better way?
You can read the data in the pop-up with:
-------------------------------------------------
// In the main window
var g_wPopUp = open( ... );
// This method is called from the pop-up when
// the user presses the "Validate" button
function validateForm()
{
var strUserName = g_wPopUp.document.formName.tfUserName.value;
// etc...
}
// In the pop-up:
<INPUT TYPE="button" VALUE="validate form"
ONCLICK="opener.validateForm();">
-------------------------------------------------
Or even better:
// In the main window
var g_wPopUp = open( ... );
// This method is called from the pop-up when
// the user presses the "Validate" button
function validateForm( frmToValidate )
{
var strUserName = frmToValidate.tfUserName.value;
// etc...
}
// In the pop-up:
<INPUT TYPE="button" VALUE="validate form"
ONCLICK="opener.validateForm(this.form);">
-------------------------------------------------
HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Webdesign, Java, javascript
:
http://www.galasoft-LB.ch
Private/Malaysia:
http://mypage.bluewin.ch/lbugnion
Support children in Calcutta:
http://www.calcutta-espoir.ch