Re: Clone of Hotmail,yahoo
| From: | Nadim Attari | Date: | Thu, 14 Aug 2003 06:39:08 +0000 |
| Subject: | Re: Clone of Hotmail,yahoo | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159527@lists.php.net to get a copy of this message | ||
> I don;t have any idea of how to implement it. i.e the TextBox so a present
Page shoulg get the value from the other independent form.
Use the example below and suit it according to your context. I remind you
that it's not a PHP thing, only JavaScript; But you can use PHP to show the
email addresses.
==========
MainForm.htm
==========
<html>
<head>
<title>Admin Section</title>
<script language="javascript">
function CategoryPicker()
{
var w_width = 500;
var w_height = 500;
var screen_width = screen.width;
var screen_height = screen.height;
var w_top = (screen_height/2) - (w_height/2);
var w_left = (screen_width/2) - (w_width/2);
window.open('picker.htm','CategoryPicker','scrollbars=yes,width='+w_width+',
height='+w_height+', top='+w_top+',left='+w_left+'');
}
function ValidateForm()
{
if (document.CategoryForm.Category.value == "")
{
alert("Please enter a Category Name !!!");
document.CategoryForm.Category.focus();
return;
}
document.CategoryForm.submit();
}
</script>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0"
width="100%">
<tr>
<td width="80%" valign="top" align="center">
<!-- The main section starts here -->
<form method='POST' name='CategoryForm'
action='category_create.php'>
<input type='hidden' name='pid' value='0'>
<table border='0' cellpadding='0' cellspacing='0'
width='100%'>
<tr>
<td width='25%' valign='middle' align='right'
height='25'><font
face='Arial' size='2'><b>Parent
Category:</b></font></td>
<td width='5%'></td>
<td width='70%' height='25'><input type='text'
name='PCategory'
size='45' tabindex='4' value='New Top Category'
readonly='true'> <input
type='button' name='SelPCat' value='...' tabindex='5'
OnClick="javascript:CategoryPicker();"></td>
</tr>
<tr><td width='100%' colspan='3' valign='middle'
align='center'
height='25'><input type='button' value='Submit'
name='Submit' tabindex='6'
OnClick="javascript:ValidateForm();"> <input type='reset'
value='Reset'
name='Reset' tabindex='7'></td></tr>
</table>
</form>
<!-- The main section ends here -->
</td>
</tr>
</table>
</body>
</html>
=======
picker.htm
=======
<html>
<head>
<title>Categories</title>
<script language="javascript">
function ReturnCategory(CategoryName, pId)
{
opener.CategoryForm.pid.value = pId;
opener.CategoryForm.PCategory.value = CategoryName;
window.close();
}
</script>
</head>
<body>
<form name='CategorySelector'>
<table border='0' cellpadding='0' cellspacing='0'
width='95%'>
<tr>
<td width='10%' valign='top' align='center'><font
face='Arial'
size='2'>1</font></td>
<td width='10%'></td>
<td width='75%' valign='top'><font size='2'
face='Arial'><a
href="JavaScript:ReturnCategory('Category-1',
'1')">Category-1</a></font></td>
</tr>
<tr>
<td width='10%' valign='top' align='center'><font
face='Arial'
size='2'>1</font></td>
<td width='10%'></td>
<td width='75%' valign='top'><font size='2'
face='Arial'><a
href="JavaScript:ReturnCategory('Category-2',
'2')">Category-2/a></font></td>
</tr>
<tr>
<td width='10%' valign='top' align='center'><font
face='Arial'
size='2'>1</font></td>
<td width='10%'></td>
<td width='75%' valign='top'><font size='2'
face='Arial'><a
href="JavaScript:ReturnCategory('Category-3',
'3')">Category-3/a></font></td>
</tr>
</table>
</form>
</body>
</html>
// Hope it helps.
// Regards,
//
// Mohammad Nadim Attari