diff --git a/webapp_create_post.py b/webapp_create_post.py
index d92120982..408694c7e 100644
--- a/webapp_create_post.py
+++ b/webapp_create_post.py
@@ -360,9 +360,9 @@ def htmlNewPost(cssCache: {}, mediaInstance: bool, translate: {},
'itemQty', 1, 1, 999999, 1)
extraFields += '
' + \
editTextField(translate['Type of shared item. eg. hat'] + ':',
- 'itemType', '')
+ 'itemType', '', '', True)
catStr = translate['Category of shared item. eg. clothing']
- extraFields += editTextField(catStr + ':', 'category', '')
+ extraFields += editTextField(catStr + ':', 'category', '', '', True)
extraFields += '
'
extraFields += \
editNumberField(translate['Duration of listing in days'],
diff --git a/webapp_utils.py b/webapp_utils.py
index 00221fe4f..428979331 100644
--- a/webapp_utils.py
+++ b/webapp_utils.py
@@ -1155,7 +1155,7 @@ def endEditSection() -> str:
def editTextField(label: str, name: str, value: str = "",
- placeholder: str = "") -> str:
+ placeholder: str = "", required: bool = False) -> str:
"""Returns html for editing a text field
"""
if value is None:
@@ -1163,10 +1163,13 @@ def editTextField(label: str, name: str, value: str = "",
placeholderStr = ''
if placeholder:
placeholderStr = ' placeholder="' + placeholder + '"'
+ requiredStr = ''
+ if required:
+ requiredStr = ' required'
return \
'
\n' + \
' \n'
+ value + '"' + placeholderStr + requiredStr + '>\n'
def editNumberField(label: str, name: str, value: int = 1,