www.webdeveloper.com
Results 1 to 2 of 2

Thread: how to make a modal popup window submit ONLY to itself?

  1. #1
    Join Date
    Apr 2009
    Posts
    77

    how to make a modal popup window submit ONLY to itself?

    Hi all :-)

    I posted this yesterday, but no one replied. Not sure if my post was too long before? Or if the way I worded things scared people off? This is got to be totally easy for someone who is fluent in js.. Anyway I'll try to ask again from another angle:

    I have a js popup window with a form in it that submits to itself, but instead of updating the content (render/display) in that modal popup window, it updates the parent browser window that had the link to open the popup. I need the popop to only update itself, and leave the parent window alone. How?

    To see what I mean, please visit here:

    http://vlt.specsimple.com/virtulibra...=1&d=1ymeeting

    ..ignore the window that popups (WelcometoNewVL.html) when you first land here. You can close that.

    On the page we are interested in (virtulibrary.html), under the main graphic, and to the right edge, click the link "post a new meeting". It opens a javascript popup window. In this popup, input "govinda" for the rep name, "12:00 am" for the start time, and "Afternoon Meeting" for the meeting focus. Then click the 'submit your meeting' button. This form action lands us on the "RepMeetings.html" page (the same file as the popup we just submitted from), but what I need is for that form submission to land us on that page *but within* the same popup window we were in before we submitted, *rather than* closing the js popup window and replacing the original "virtulibrary.html" page that let us open that js popup in the first place. Did I make sense? How can I do that?

    thanks for looking!
    -Govinda

  2. #2
    Join Date
    Apr 2009
    Posts
    77

    Question

    These notes might help you spot where the tweak needs to be. ?

    --------------------------------

    the "post a new meeting" link is like this:

    HTML Code:
    <a href="#" onclick="displayMessage('Intranet_IE/RepMeetings.html?xxx=[yyy]&aaa=[bbb]&etc.. ');return false">
    post a new meeting</a>

    --------------------------------

    that 'displayMessage' function comes from here, higher up the page:

    Code:
    <script type="text/javascript">
    messageObj = new DHTML_modalMessage();	// We only create one object of this class
    messageObj.setShadowOffset(5);	// Large shadow
    
    function displayMessage(url)
    {
    	
    	messageObj.setSource(url);
    	messageObj.setCssClassMessageBox(false);
    	messageObj.setSize(400,400);
    	messageObj.setShadowDivVisible(true);	// Enable shadow for these boxes
    	messageObj.display();
    }
    --------------------------------

    'DHTML_modalMessage' seems to come from this code:

    Code:
    DHTML_modalMessage = function()
    {
    	var url;								// url of modal message
    	var htmlOfModalMessage;					// html of modal message
    	
    	var divs_transparentDiv;				// Transparent div covering page content
    	var divs_content;						// Modal message div.
    	var iframe;								// Iframe used in ie
    	var layoutCss;							// Name of css file;
    	var width;								// Width of message box
    	var height;								// Height of message box
    	
    	var existingBodyOverFlowStyle;			// Existing body overflow css
    	var dynContentObj;						// Reference to dynamic content object
    	var cssClassOfMessageBox;				// Alternative css class of message box - in case you want a different appearance on one of them
    	var shadowDivVisible;					// Shadow div visible ? 
    	var shadowOffset; 						// X and Y offset of shadow(pixels from content box)
    	var MSIE;
    		
    	this.url = '';							// Default url is blank
    	this.htmlOfModalMessage = '';			// Default message is blank
    	this.layoutCss = 'modal-message.css';	// Default CSS file
    	this.height = 200;						// Default height of modal message
    	this.width = 400;						// Default width of modal message
    	this.cssClassOfMessageBox = false;		// Default alternative css class for the message box
    	this.shadowDivVisible = true;			// Shadow div is visible by default
    	this.shadowOffset = 5;					// Default shadow offset.
    	this.MSIE = false;
    	if(navigator.userAgent.indexOf('MSIE')>=0) this.MSIE = true;
    	
    }
    which is in this library (if I said this right):
    /test/MODAL/js/modal-message.js

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles