Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit faccfea

Browse files
User page form validation
1 parent a5cbe06 commit faccfea

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

js/languages/en-US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
"Categorization": "Categorization",
107107
"Expiration": "Expiration",
108108
"Search": "Search",
109+
"Username": "Username",
109110
"Email": "Email",
110111
"Facebook": "Facebook",
111112
"Instagram": "Instagram",

js/templates/settings.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ <h3 class="padding15 margin0 fontWeight500"><%= polyglot.t('Social') %></h3>
319319

320320
<div class="flexCol-9 borderRight0 custCol-border">
321321
<input name="website"
322-
type="text"
322+
type="url"
323323
id="website"
324324
placeholder="http://mywebsite.com"
325325
class="fieldItem"
@@ -336,7 +336,7 @@ <h3 class="padding15 margin0 fontWeight500"><%= polyglot.t('Social') %></h3>
336336

337337
<div class="flexCol-9 borderRight0 custCol-border">
338338
<input name="email"
339-
type="text"
339+
type="email"
340340
id="email"
341341
placeholder="[email protected]"
342342
class="fieldItem"
@@ -356,7 +356,8 @@ <h3 class="padding15 margin0 fontWeight500"><%= polyglot.t('Social') %></h3>
356356
type="text"
357357
id="settingsFacebookInput"
358358
data-type="facebook"
359-
placeholder="<%= polyglot.t('Facebook') %>"
359+
pattern="^[a-z\d\.]{5,}$"
360+
placeholder="<%= polyglot.t('Username') %>"
360361
class="fieldItem"
361362
value="<%= ob.page.profile.social_accounts.facebook.username %>">
362363
</div>
@@ -374,7 +375,8 @@ <h3 class="padding15 margin0 fontWeight500"><%= polyglot.t('Social') %></h3>
374375
type="text"
375376
id="settingsTwitterInput"
376377
data-type="twitter"
377-
placeholder="<%= polyglot.t('Twitter') %>"
378+
pattern="^[A-Za-z0-9_]{1,32}$"
379+
placeholder="<%= polyglot.t('Username') %>"
378380
class="fieldItem"
379381
value="<%= ob.page.profile.social_accounts.twitter.username %>">
380382
</div>
@@ -392,7 +394,8 @@ <h3 class="padding15 margin0 fontWeight500"><%= polyglot.t('Social') %></h3>
392394
type="text"
393395
id="settingsInstagramInput"
394396
data-type="instagram"
395-
placeholder="<%= polyglot.t('Instagram') %>"
397+
pattern="([A-Za-z0-9_](?:(?:[A-Za-z0-9_]|(?:\.(?!\.))){0,28}(?:[A-Za-z0-9_]))?)"
398+
placeholder="<%= polyglot.t('Username') %>"
396399
class="fieldItem"
397400
value="<%= ob.page.profile.social_accounts.instagram.username %>">
398401
</div>
@@ -410,7 +413,7 @@ <h3 class="padding15 margin0 fontWeight500"><%= polyglot.t('Social') %></h3>
410413
type="text"
411414
id="settingsSnapchatInput"
412415
data-type="snapchat"
413-
placeholder="<%= polyglot.t('Snapchat') %>"
416+
placeholder="<%= polyglot.t('Username') %>"
414417
class="fieldItem"
415418
value="<%= ob.page.profile.social_accounts.snapchat.username %>">
416419
</div>

0 commit comments

Comments
 (0)