• About
  • Sitemap
  • Privacy Policy
  • Disclaimer
  • Contact

kumpulan skripsi teknik informasi

Kumpulan Skripsi Gratis, Download Skripsi Gratis

  • Beranda
  • Skripsi
  • Artikel
  • Tutorial
    • Php
    • Javascript
  • Trik dan Tips
  • Unik dan Menarik
  • Blogging
Home » Javascript » Send variable value from popup to parent

Send variable value from popup to parent

Java script can pass value from parent to pop up and also can pass value from pop up to parent. First thing that we do is make a Java script function in parent page . here is the simple example :
1. Make a page as parent page :

<html>

<head>

<title>Parent Page</title>

<script language="javascript">
//this function for getting value from popup
 
 function GetValueFromChild(myVal)

    {

        document.getElementById('mytxt').value = myVal;

    }

// this function for opening new window popup
function mypopup() {
    window.open('mypopup.php','popup','width=150','height=100','toolbar=no','status=no');   
}


</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="test" method="post">
<input type="text" name="mytxt" id="mytxt">
<input type="button" name="mybut" onClick="cari()" value="popup">

</form>

</body>
</html>


save this as parent.php

then the second is you have to make a popup file that can be opened by parent.php
look the script below for  popup.:

<html>
<head>
<title>Popup</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
function SendValueToParent()

    {

        var myVal = document.getElementById('mytxt').value;

        window.opener.GetValueFromChild(myVal);

        window.close();

        return false;

    }


</script>
</head>

<body>
<form name="a" method="post">
<input type="text" name="myvar" id="mytxt">
<input type="button" name="mysub"  value="Send" onClick="SendValueToParent()">
</form>
</body>
</html>

Save this script as mypopup.php.

the would be like the picture below :

from this example you may improve to other case like searching data and send it to parent form.
OK, thank see u..

download script here or here to


Ditulis oleh herizal, Tuesday, 11 June 2013 - Rating: 4.5
Judul : Send variable value from popup to parent
Deskripsi : Java script can pass value from parent to pop up and also can pass value from pop up to parent. First thing that we do is make a Java script...

Bagikan ke

Facebook Google+ Twitter

Belum ada komentar untuk "Send variable value from popup to parent"

Post a Comment

Newer Post
Older Post
Home
Subscribe to: Post Comments (Atom)

Academics Blogs
Top Blogs
Computers Blogs
submit a blog

fanpage

Counter

Arsip

Skripsi Komputer ( 43 ) Tugas Akhir ( 12 ) php ( 10 ) Artikel ( 5 ) php series ( 3 ) Javascript ( 2 ) Skripsi Hukum ( 1 ) Skripsi Teknik ( 1 ) serial ( 1 )
Visit Herizal Amin at Ping.sg
Copyright © 2012 kumpulan skripsi teknik informasi - All Rights Reserved
Design by Mas Sugeng - Powered by Blogger