summaryrefslogtreecommitdiff
path: root/views/message_send.ejs
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-11-10 22:27:46 +0100
committerTor Andersson <tor@ccxvii.net>2021-11-13 18:38:17 +0100
commit0d0dab23fb0ecf16a2abf54295746d7dbd87c2d7 (patch)
tree84c1ba816d81659860630fa7eb5a798605425161 /views/message_send.ejs
parent66450e7666abdaced2347825a4b9e13bc0528251 (diff)
downloadserver-0d0dab23fb0ecf16a2abf54295746d7dbd87c2d7.tar.gz
Massive SQL cleanup.
Diffstat (limited to 'views/message_send.ejs')
-rw-r--r--views/message_send.ejs11
1 files changed, 7 insertions, 4 deletions
diff --git a/views/message_send.ejs b/views/message_send.ejs
index 6f72d74..4dafa3a 100644
--- a/views/message_send.ejs
+++ b/views/message_send.ejs
@@ -1,6 +1,6 @@
<%- include('header', { title: "Send Message" }) %>
<style>
-input, textarea { width: 100%; max-width: 45em; }
+input, textarea { width: 100%; max-width: 45rem; }
</style>
<form action="/message/send" method="post">
<p>
@@ -8,7 +8,7 @@ To:<br>
<input id="to" type="text" name="to" size="80" maxlength="80"
onkeypress="if(event.keyCode===13){document.querySelector('#subject').focus();return false;}"
value="<%= to_name %>"
- <%= to_id === 0 ? "autofocus" : "" %>
+ <%= (to_name === "") ? "autofocus" : "" %>
required>
<p>
@@ -17,14 +17,17 @@ Subject:
<input id="subject" type="text" name="subject" size="80" maxlength="80"
onkeypress="if(event.keyCode===13){document.querySelector('#body').focus();return false;}"
value="<%= subject %>"
- <%= to_id > 0 ? "autofocus" : "" %>
+ <%= (to_name !== "" && subject === "") ? "autofocus" : "" %>
pattern=".*\S+.*"
required>
<p>
Body:
<br>
-<textarea id="body" name="body" rows="20" cols="80" maxlength="32000" required><%= body %></textarea>
+<textarea id="body" name="body" rows="20" cols="80" maxlength="32000"
+ <%= (to_name !== "" && subject !== "") ? "autofocus" : "" %>
+ required>
+<%= body %></textarea>
<p>
<button type="submit">Send</button>
</form>