cvs: pearweb /public_html account-mail.php
| From: | Martin Jansen | Date: | Tue, 28 May 2002 15:18:34 +0000 |
| Subject: | cvs: pearweb /public_html account-mail.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-4205@lists.php.net to get a copy of this message | ||
mj Tue May 28 11:18:34 2002 EDT
Modified files:
/pearweb/public_html account-mail.php
Log:
* Focus field in contact form.
Index: pearweb/public_html/account-mail.php
diff -u pearweb/public_html/account-mail.php:1.4 pearweb/public_html/account-mail.php:1.5
--- pearweb/public_html/account-mail.php:1.4 Sun May 5 03:59:38 2002
+++ pearweb/public_html/account-mail.php Tue May 28 11:18:30 2002
@@ -2,7 +2,7 @@
/**
* Send mail to PEAR contributor
*
- * $Id: account-mail.php,v 1.4 2002/05/05 07:59:38 mj Exp $
+ * $Id: account-mail.php,v 1.5 2002/05/28 15:18:30 mj Exp $
*/
/**
@@ -21,15 +21,19 @@
function printForm($data = array())
{
+ // The first field that's empty
+ $focus = '';
+
foreach (array('name', 'email', 'subject', 'text') as
$key) {
if (!isset($data[$key])) {
$data[$key] = '';
+ ($focus == '') ? $focus = $key : '';
}
}
- $bb = new Borderbox('Send email');
+ $bb = new BorderBox('Send email');
+ $form = new HTML_Form($_SERVER['PHP_SELF'] . '?handle=' .
$_GET['handle'], 'post', 'contact');
- $form = new HTML_Form($_SERVER['PHP_SELF'] . '?handle=' .
$_GET['handle'], 'post');
$form->addText('name', 'Your name:', $data['name'], 30);
$form->addText('email', 'EMail address:', $data['email'], 30);
$form->addText('subject', 'Subject:', $data['subject'], 30);
@@ -38,6 +42,12 @@
$form->display();
$bb->end();
+
+ echo "<script language=\"JavaScript\">\n";
+ echo "<!--\n";
+ echo "document.forms.contact." . $focus . ".focus();\n";
+ echo "-->\n";
+ echo "</script>";
}
// }}}