How to Get Values from popup to parent

Posted by druva | HTML, JS, utils | Wednesday 9 December 2009 7:19 am

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>
 

Include PHP files in HTML pages using .HTACCESS

Posted by admin | HTML, php, utils | Tuesday 8 September 2009 12:40 am

Usually, its not possible to include PHP files into HTML pages. Here i got a way for this which works. Its nothing but using .HTACCESS.

Create a .HTACCESS file in the root folder or a specified folder.
Add the below code  into your .HTACCESS file

Options +FollowSymLinks
AddType application/x-httpd-php .htm

Thats it

Now, you can include PHP files into your Static HTML Pages.

 

Open PoPup From Flash

Posted by druva | Flash, Flex, as3, utils | Friday 20 March 2009 1:21 pm
var b:Button = new Button();
b.label = 'openNewWindow';
addChild(b);
b.addEventListener(MouseEvent.MOUSE_DOWN, OpenPopUpWindow);
function OpenPopUpWindow(e:MouseEvent):void {
  var result:String = ;
  var url:URLRequest = new URLRequest("javascript:window.open('http://www.totusinfo.com','win','height=800,
           width=800,toolbar=yes,scrollbars=yes');void(0);");
  navigateToURL(url, "_self");
}