hbmarar
05-25-2005, 07:13 AM
hi,
I am in my first project and need help with the following.
I want a form for taking five values and if there is second reading I want to provide a link that should be doing as below:
1.insert a new row as shown in load page
2.this option should be able to repeat 8 times.
Or,
on clicking the link for more reading it should popup a window with the filds for entry and it should pass that values to variables in the parent page...
I am not that expert in Javascript and it would of great help if somebody could share with me a sample example...I have got a sample one but do not know how to assign the popup varibles to parent script.
------------------------------------------------
<SCRIPT LANGUAGE=JAVASCRIPT><!--
function windowOpen() {
var myWindow=window.open('popup.html','windowRef','width=200,height=200');
myWindow.location.href = 'popup.html';
if (!myWindow.opener)
myWindow.opener = self;
}
windowOpen();
----------------------------------------------
<SCRIPT LANGUAGE=JAVASCRIPT><!--
function returnDetails() {
//the below line confuses me alot.....
opener.location.href = 'whatever.cgi?login=' + escape(document.myForm.loginname.value) + '&password=' + escape(document.myForm.loginpassword.value);
setTimeout('window.close()',500);
}
//--></SCRIPT>
<FORM NAME="myForm">
Name: <INPUT TYPE="TEXT" NAME="loginname">
Password: <INPUT TYPE="PASSWORD" NAME="loginpassword">
<INPUT TYPE="BUTTON" VALUE="ENTER" onClick="returnDetails()">
</FORM>
----------------------------
thankin you
Harish Balakrishnan Marar
I am in my first project and need help with the following.
I want a form for taking five values and if there is second reading I want to provide a link that should be doing as below:
1.insert a new row as shown in load page
2.this option should be able to repeat 8 times.
Or,
on clicking the link for more reading it should popup a window with the filds for entry and it should pass that values to variables in the parent page...
I am not that expert in Javascript and it would of great help if somebody could share with me a sample example...I have got a sample one but do not know how to assign the popup varibles to parent script.
------------------------------------------------
<SCRIPT LANGUAGE=JAVASCRIPT><!--
function windowOpen() {
var myWindow=window.open('popup.html','windowRef','width=200,height=200');
myWindow.location.href = 'popup.html';
if (!myWindow.opener)
myWindow.opener = self;
}
windowOpen();
----------------------------------------------
<SCRIPT LANGUAGE=JAVASCRIPT><!--
function returnDetails() {
//the below line confuses me alot.....
opener.location.href = 'whatever.cgi?login=' + escape(document.myForm.loginname.value) + '&password=' + escape(document.myForm.loginpassword.value);
setTimeout('window.close()',500);
}
//--></SCRIPT>
<FORM NAME="myForm">
Name: <INPUT TYPE="TEXT" NAME="loginname">
Password: <INPUT TYPE="PASSWORD" NAME="loginpassword">
<INPUT TYPE="BUTTON" VALUE="ENTER" onClick="returnDetails()">
</FORM>
----------------------------
thankin you
Harish Balakrishnan Marar