Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Mar 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can A Parent Window Send Some Values Present In It To A Popup Child Window??

    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>

  • #2
    New to the CF scene
    Join Date
    Mar 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Sorry, misread your post
    Last edited by Mr J; 03-11-2006 at 04:42 PM.
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #4
    New to the CF scene
    Join Date
    Mar 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •