Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    16

    Question Unanswered: Data transfer between web pages

    Hello

    Is there a way of updating a field on a web page from another, without using the reload function.

    The application I am creating is running a number of queries to a DB2 database. Due to the response times I have put each query into a separate iframe but I want to be able to update a field on the main page from several of the queries.

    Regards
    James

  2. #2
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    You'd have to do this with JavaScript. I have a page that contains an iframe. When my parent window submit's its form to the iframe, I use Javascript in the iframe to update the parent frame.
    That which does not kill me postpones the inevitable.

  3. #3
    Join Date
    Sep 2003
    Posts
    16
    Hello

    Thanks for that. Can you tell me how you do that? Do you use document.all?

    Regards
    James

    Originally posted by Seppuku
    You'd have to do this with JavaScript. I have a page that contains an iframe. When my parent window submit's its form to the iframe, I use Javascript in the iframe to update the parent frame.

  4. #4
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    It's really dependant upon the browser you're targetting, but in IE, you can reference the parent window with "window.parent".

    What I did was have a form on the parent window that had several fields. When the value of the field changed I change the URL of the IFrame to pass a querystring of the field and value to be validated against some DB info. The page in the IFrame queries the DB, validates the value (or doesn't), then writes some javascript to change the color or background of the field on the parent window accordingly. So the JavaScript on the IFrame used "window.parent" to make those changes.

    Example:
    Code:
    window.parent.document.myForm.phonenum.style.color = '#FF0000';
    This would change the color of the text in the field "phonenum" on the parent window to red from the IFrame.
    That which does not kill me postpones the inevitable.

  5. #5
    Join Date
    Sep 2003
    Posts
    16

    Thumbs up

    Thanks for the example. That's exactly what I need.

    Regards,
    James

Posting Permissions

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