...

View Full Version : Can A Parent Window Send Some Values Present In It To A Popup Child Window??



maruvada
03-11-2006, 03:29 PM
Hello...........

IS THERE A WAY WHERE IN THE PARENT WINDOW MAY SEND SOME VALUES IN IT TO THE CHILD WINDOW THAT IS BEING POP-UP??

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>ProjectID</title>
<script language="JavaScript"> // src="ts_picker.js">

function addtask()
{
DispWin=window.open('AddTask.jsp','NewWin','scroll=yes,toolbar=no,status=no,width=500,height=350');
}
function modifytask()
{
DispWin=window.open('ModifyTask.jsp','NewWin','scroll=yes,toolbar=no,status=no,width=500,height=350' );
}
function deletetask()
{
DispWin=window.open('DeleteTask1.jsp','NewWin','scroll=yes,toolbar=no,status=no,width=500,height=350 ');


}

</script>

</head>



<body>

<input type=button value=AddTask name=AddTask onclick="addtask();">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=button value=ModifyTask name=ModifyTask onclick="modifytask();">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=submit value=DeleteTask name=DeleteTask">
</form>
</fieldset>
</td></tr></table>
</body>

maruvada
03-11-2006, 03:35 PM
Hello.....
I am also facing another problem with a pop-up window.
I have the code where in........i have a web page....

(1) on-click on a button pop-ups a form.
(2) The popup form is through window.open()
(3) I am validating the form in JAVASCRIPT function and then in turn calling another JSP on proper validation.

My problem is that i need to use the ACTION attribute in form so as to send the form values.....apart from validating in JAVASCRIPT.

And if I do so, then there are two events.......onclick().....validation and onsubmit.....calling another JSP.

On validation, I print the textboxes in RED color to indicate error msg.

Since, the JSP is also called through submit() of the ACTION event in the form.....the page is getting refreshed.


CODE:

<script language="JavaScript">

function validate(form)
{
var flag=0;
var regexp=/[0-9]*/;

if(document.AddTasks.TaskName.value=="")
{
document.AddTasks.TaskName.style.backgroundColor='red';
flag=1;
}
</script>


CODE FOR THE FORM:



<form method="POST" name="AddTasks" action="AddTask.jsp">
.....................
....................
<input type="submit" value="Add Task" name="AddTask" onclick=validate(this);>

Here comes the problem.......onclick i am calling validate().....and since it is of type submit().........the form ACTION attribute also calls "Addtask.jsp".......and this call is a must since i need to send some values to another JSP where in i access them using REQUEST.GETPARAMTER().......i need to use the ACTION attribute call...to do so....



Please tell me a way to tackle this problem so that I can validate and show the errors and as well call a JSP on proper validation.

Mr J
03-11-2006, 03:36 PM
Sorry, misread your post

maruvada
03-11-2006, 03:41 PM
Hello.....

My last problem with pop-up windows is linked to the above scenario....


There is also a scenario where....the pop-up window calls a JSP and the JSP inturn REDIRECTS the result to the parent window.

IF THE POP-UP CHILD WINDOW IS OPEN.......THEN THE REDIRECTION IS BEING SENT TO THE POP-UP WINDOW(THE RESULT BEING DISPLAYED IN THE POP-UP WINDOW AND NOT THE PARENT WINDOW..THAT HAS POP-UP).


THE OTHER WAY ROUND...IF I CHOSE TO CLOSE TO CLOSE THE POP-UP WINDOW.....UPON AN EVENT.....THE PAGE(OF THE PARENT WINDOW) IS NOT GETTING REFRESHED AUTOMATICALLY)...EVENTHOUGH I CHOSE TO REDIRECT TO IT.

Please tell me a way so that I can close the pop-up window...and AUTOMATIC PAGE REFRESH is done to the parent window upon REDIRECTING TO IT.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum