We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any reason for not having a button element with type="submit"?"
I created a new widget
class Button: html_params = staticmethod(html_params) validation_attrs = ["required"] def __init__(self, input_type=None): if input_type is not None: self.input_type = input_type def __call__(self, field, **kwargs): kwargs.setdefault("id", field.id) kwargs.setdefault("type", self.input_type) flags = getattr(field, "flags", {}) for k in dir(flags): if k in self.validation_attrs and k not in kwargs: kwargs[k] = getattr(flags, k) return Markup("<button %s>%s</button>" % (self.html_params(name=field.name, **kwargs), field.label.text)) class SubmitButton(Button): input_type = "submit" def __call__(self, field, **kwargs): return super().__call__(field, **kwargs) class SubmitButtonField(BooleanField): widget = SubmitButton()
class CreateForm(Form): submit = SubmitField("Edit") submit_button = SubmitButtonField("Edit")
The text was updated successfully, but these errors were encountered:
I think this is simply because submit button became popular more or less recently in the HTML history.
Sorry, something went wrong.
type="submit" is already the (not very great) default for a <button> element...
type="submit"
<button>
No branches or pull requests
Any reason for not having a button element with type="submit"?"
I created a new widget
The text was updated successfully, but these errors were encountered: