If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Data transfer between web pages

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-28-03, 21:21
jamesO jamesO is offline
Registered User
 
Join Date: Sep 2003
Posts: 16
Question 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
Reply With Quote
  #2 (permalink)  
Old 10-31-03, 14:47
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #3 (permalink)  
Old 11-02-03, 16:54
jamesO jamesO is offline
Registered User
 
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

Quote:
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.
Reply With Quote
  #4 (permalink)  
Old 11-03-03, 12:32
Seppuku Seppuku is offline
Useless...
 
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.
Reply With Quote
  #5 (permalink)  
Old 11-03-03, 17:25
jamesO jamesO is offline
Registered User
 
Join Date: Sep 2003
Posts: 16
Thumbs up

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

Regards,
James
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On