Skip to content

Commit

Permalink
Fixed locked fields in htmlform
Browse files Browse the repository at this point in the history
  • Loading branch information
kesse committed Jun 26, 2019
1 parent d46f1b7 commit 3391791
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions htmlform.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,20 @@ def __str__(self):
for field in self.fields:
s += '<div class="form-group">'
s += '<label for="' + field[0] + '">' + field[2] + '</label>'
s += '<input {% if disabled %}disabled="disabled{% endif %} type="' + field[3] + '" class="form-control" size="50" {% if field[4] %}required=""{% endif %} name="' + field[0] + '" id="' + field[0] + '" value="' + str(field[1]) + '"/>'
s += '<input '
if self.disabled:
s += 'disabled="disabled '
s += 'type="' + field[3] + '" class="form-control" size="50" '

if field[4]:
s += 'required="required" '
s += 'name="' + field[0] + '" id="' + field[0] + '" value="' + str(field[1]) + '"/>'
s += '</div>'
s += '<div class="btn-toolbar">'
s += '<button {% if disabled %}disabled="disabled{% endif %} type="submit" name="submit" class="btn btn-lg ' + self.buttonType +'">' + self.submittext + '</button>'
s += '<button '
if self.disabled:
s += 'disabled="disabled '
s += 'type="submit" name="submit" class="btn btn-lg ' + self.buttonType +'">' + self.submittext + '</button>'
s += '</div>'
s += '</form>'
return s

0 comments on commit 3391791

Please sign in to comment.