Go Back   Webmaster Malaysia Forum » Website Design & Development » Website Programming

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-08-2006, 01:55 PM
semutpower's Avatar
New kid on the block
 
Join Date: Jul 2006
Location: Kajang
Posts: 3
Rep Power: 0
semutpower is on a distinguished road
Return value to parent windows

Hai...

Aku nak tanya sapa-sapa yang tau macam mana nak buat popup windows & kemudian return value ke dalam parent windows.

TQ...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 18-08-2006, 02:17 AM
New kid on the block
 
Join Date: Aug 2006
Location: malacca
Posts: 2
Rep Power: 0
ed_tm is on a distinguished road
ni bukan bende yg exactly ko nak. mungkin berguna utk ko. ni utk refresh parent. bole la ubah pape sket. aku buat bende ni utk open popup > klik button (update database) > popup close > refresh parent.


Code:
<script language="JavaScript">
<!--
function refreshParent() {
  window.opener.location.href = window.opener.location.href;
  if (window.opener.progressWindow)
    window.opener.progressWindow.close();
  window.close();
}
//-->
</script>
tambah sket kat body

PHP Code:
<?php
  
if ($updateSQL) {
  echo 
"<body onload='refreshParent()'>"; }
  
  
?>
$updateSQL = updaate DB.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 30-08-2006, 03:11 PM
New kid on the block
 
Join Date: Aug 2006
Location: Perak
Posts: 7
Rep Power: 0
chan0923 is on a distinguished road
This is one way to do it :

first write a javascript function in your parent page :

Code:
function set(id, value) {
     document.getElementById(id).value = value;
}
then, in your popup page, add the appropriate javascript (let's say after clicking a button the page will close and return the value)

Code:
function closePopup(target_id) {
     window.opener.set(target_id, '123');
     window.close();
}
add the onClick event on a button in the popup page :

HTML Code:
<input type="submit" name="Submit" value="OK" onclick="return closePopup('textBox1')">
So, when u click the button, it will set the value of 'textBox1' in the mainpage to '123' and then close the popup page. You can modify the closePopup() function and return the correct value.

Hope this help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent refresh at opened window when parent is refreshing hajime Website Design 0 18-12-2005 10:34 AM
return value from oracle.. shakker Website Programming 0 23-08-2004 09:38 AM
Small Investment, Big Return!!! campb Mamak Stall 2 22-08-2004 06:38 PM



All times are GMT +8. The time now is 07:04 AM. Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.


WebmasterMalaysia.com is Proudly Hosted by Exabytes Semi Dedicated Server.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58