* @param string $sValue initial field value
* @param integer $iSize field size (number of characters)
* @param integer $iMaxlength maximum number of characters the user may enter
- * @param array $aAttribs (since 1.5.1) extra attributes
+ * @param array $aAttribs (since 1.5.1) extra attributes - should be given
+ * in the form array('attribute_name' => 'attribute_value', ...)
* @return string html formated text input field
*/
function addInput($sName, $sValue = '', $iSize = 0, $iMaxlength = 0, $aAttribs=array()) {
$sEnctype . $sName . $sCharset . $sAttribs . ">\n";
}
-?>
\ No newline at end of file
+?>
$mailprio, $compose_new_win, $saved_draft, $mail_sent, $sig_first,
$username, $compose_messages, $composesession, $default_charset;
+ if (checkForJavascript()) {
+ $onfocus = ' onfocus="alreadyFocused=true;"';
+ $onfocus_array = array('onfocus' => 'alreadyFocused=true;');
+ }
+ else {
+ $onfocus = '';
+ $onfocus_array = array();
+ }
+
$composeMessage = $compose_messages[$session];
if ($values) {
$send_to = $values['send_to'];
html_tag( 'td', '', 'right', $color[4], 'width="10%"' ) .
_("To") . ':</td>' . "\n" .
html_tag( 'td', '', 'left', $color[4], 'width="90%"' ) .
- addInput('send_to', $send_to, 60). '<br />' . "\n" .
+ addInput('send_to', $send_to, 60, 0, $onfocus_array). '<br />' . "\n" .
' </td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n" .
html_tag( 'td', '', 'right', $color[4] ) .
_("Cc") . ':</td>' . "\n" .
html_tag( 'td', '', 'left', $color[4] ) .
- addInput('send_to_cc', $send_to_cc, 60). '<br />' . "\n" .
+ addInput('send_to_cc', $send_to_cc, 60, 0, $onfocus_array). '<br />' . "\n" .
' </td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n" .
html_tag( 'td', '', 'right', $color[4] ) .
_("Bcc") . ':</td>' . "\n" .
html_tag( 'td', '', 'left', $color[4] ) .
- addInput('send_to_bcc', $send_to_bcc, 60).'<br />' . "\n" .
+ addInput('send_to_bcc', $send_to_bcc, 60, 0, $onfocus_array).'<br />' . "\n" .
' </td>' . "\n" .
' </tr>' . "\n" .
' <tr>' . "\n" .
html_tag( 'td', '', 'right', $color[4] ) .
_("Subject") . ':</td>' . "\n" .
html_tag( 'td', '', 'left', $color[4] ) . "\n";
- echo ' '.addInput('subject', $subject, 60).
+ echo ' '.addInput('subject', $subject, 60, 0, $onfocus_array).
' </td>' . "\n" .
' </tr>' . "\n\n";
echo ' <tr>' . "\n" .
' <td bgcolor="' . $color[0] . '" colspan="2" align="center">' . "\n" .
' <textarea name="body" id="body" rows="' . (int)$editor_height .
- '" cols="' . (int)$editor_size . '" wrap="virtual">';
+ '" cols="' . (int)$editor_size . '" wrap="virtual"' . $onfocus . '>';
}
else {
echo ' <tr>' . "\n" .
' <td bgcolor="' . $color[4] . '" colspan="2">' . "\n" .
' <textarea name="body" id="body" rows="' . (int)$editor_height .
- '" cols="' . (int)$editor_size . '" wrap="virtual">';
+ '" cols="' . (int)$editor_size . '" wrap="virtual"' . $onfocus . '>';
}
if ($use_signature == true && $newmail == true && !isset($from_htmladdr_search)) {
return $succes;
}
-?>
\ No newline at end of file
+?>