How to Get Values from popup to parent

The requirement is
I had a button wen i click it a popup window will display with some values.
I have to select those values. the selected values must display in the parent window.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

 <body>

 <form>

 <table border=1>
 <th>Name</th>
 <th>Country</th>
 <tr>
 <td><input id="name" name="name" /></td>
 <td><input id="country" name="country" /></td>
 </tr>
 </table>

 <input type="button" name="choice" onClick="window.open('popup.html','popuppage',' width=350,toolbar=1,resizable=1,scrollbars=yes, height=300,top=100,left=100');" value="Add">

 </form>

 </body>

</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head>

 <SCRIPT LANGUAGE="JavaScript">
 <!-- Begin
 function sendValue (n, c){
 var name = n.value;
 var country = c.value;
 window.opener.document.getElementById('name').value = name;
 window.opener.document.getElementById('country').value = country;
 window.close();
 }
 //  End -->
 </script>

 </head>
 <body>

 <form name="selectform">

 <table width="250">

 <tr>
 <td>
 Enter your name:
 </td>
 <td>
 <input type="text" name="name" id="name">
 </td>
 </tr>

 <tr>
 <td>
 Select your country:
 </td>
 <td>
 <select name="country">
 <option value="India">India</option>
 <option value="United States">United States</option>
 <option value="United Kingdom">United Kingdom</option>
 <option value="Germany">Germany</option>
 <option value="France">France</option>
 </select>
 </td>
 </tr>

 <tr>
 <td>
 <input type=button value="submit" onClick="sendValue(this.form.name, this.form.country);">
 </td>
 </tr>

 </table>

 </form>

 </body>
</html>

Tags: , , ,

12 Responses to “How to Get Values from popup to parent on “How to Get Values from popup to parent”

  • Hi buddy, your blog’s model is simple and clean and i like it. Your blog content articles are superb. Please preserve them coming. Greets!!!

  • thanks, and keep up the great work

  • Sensational info. I look forward to seeing more.

  • Hey – good weblog, simply looking round some weblogs, appears a fairly nice platform you’re utilizing. I’m at the moment using Joomla for just a few of my sites but seeking to change certainly one of them over to a platform very much the same to this one. Anything particularly you’ll recommend?

  • I’m not sure where you’re getting your information, but good topic. I needs to spend some time learning more or understanding more. Thanks for great info I was looking for this info for my mission.

  • Simply desire to say your article is as amazing. The clearness for your submit is simply spectacular and that i could think you are knowledgeable in this subject. Well along with your permission let me to take hold of your RSS feed to stay up to date with coming near near post. Thanks one million and please carry on the gratifying work. – London Escorts – Elite Escorts Agency, 1a Charlwood Place, London, SW1V 2LX, 020 3393 4259

  • I dugg some of you post as I cerebrated they were handy very helpful

  • Thanks for the auspicious writeup. It actually was a amusement account it. Glance complicated to far brought agreeable from you! By the way, how can we be in contact?

  • I am really loving the theme/design of your weblog. Do you ever run into any internet browser compatibility issues? A small number of my blog readers have complained about my website not working correctly in Explorer but looks great in Chrome. Do you have any ideas to help fix this problem?

  • Have you looked at your site with various browsers? I¡¯m using IE 7 and the design and style is a bit off.

  • I hoped much more from this text. I found it on MSN and hoped it will be more informative

  • Thanks for the info – will check it

Hi, Stranger! Leave Your Comment...

Name (required)
Email (required)
Website