Skip to content

Commit

Permalink
#1255 Do not hardcode the tab index, update autofocus
Browse files Browse the repository at this point in the history
  • Loading branch information
Yannick committed Apr 16, 2015
1 parent f40d967 commit 4bb6c98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/draw_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1073,12 +1073,12 @@ function draw_mail_form($recipient_id) {
?>

<form id="email" method="post" action="misc.php?email=<?php echo $recipient_id ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">
<input class="info-textfield form-control" placeholder="<?php echo $lang['Subject'] ?>" type="text" name="req_subject" maxlength="70" tabindex="1" />
<input class="info-textfield form-control" placeholder="<?php echo $lang['Subject'] ?>" type="text" name="req_subject" maxlength="70" tabindex="<?php echo $cur_index++ ?>" autofocus />
<div class="panel panel-default panel-editor">
<fieldset class="postfield">
<input type="hidden" name="form_sent" value="1" />
<input type="hidden" name="redirect_url" value="<?php echo luna_htmlspecialchars($redirect_url) ?>" />
<textarea name="req_message" class="form-control textarea" rows="10" tabindex="2"></textarea>
<textarea name="req_message" class="form-control textarea" rows="10" tabindex="<?php echo $cur_index++ ?>"></textarea>
<div class="btn-toolbar textarea-toolbar textarea-bottom">
<div class="btn-group pull-right">
<button class="btn btn-with-text btn-primary" type="submit" name="submit" accesskey="s" tabindex="<?php echo $cur_index++ ?>"><span class="fa fa-fw fa-envelope-o"></span> <?php echo $lang['Send'] ?></button>
Expand Down
2 changes: 1 addition & 1 deletion themes/Luna/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}

if ($fid): ?>
<label class="required hidden"><?php echo $lang['Subject'] ?></label><input class="info-textfield form-control" placeholder="<?php echo $lang['Subject'] ?>" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo luna_htmlspecialchars($subject); ?>" maxlength="70" tabindex="<?php echo $cur_index++ ?>"<?php if (!$luna_user['is_guest']) { echo ' autofocus="autofocus"'; } ?> />
<label class="required hidden"><?php echo $lang['Subject'] ?></label><input class="info-textfield form-control" placeholder="<?php echo $lang['Subject'] ?>" type="text" name="req_subject" value="<?php if (isset($_POST['req_subject'])) echo luna_htmlspecialchars($subject); ?>" maxlength="70" tabindex="<?php echo $cur_index++ ?>"<?php if (!$luna_user['is_guest']) { echo ' autofocus'; } ?> />
<?php endif; ?>
<?php draw_editor('20'); ?>
</form>

0 comments on commit 4bb6c98

Please sign in to comment.