StartBootstrap / pro-feedback

11 stars 3 forks source link

Python / Flask / Passing a "Name" to input? #31

Open hgcsm opened 3 years ago

hgcsm commented 3 years ago

I'm using Python 3.8/Flask and this template and ran into an error with inputs.

If I use the form as proposed:

<mwc-textfield class="w-100" label="Username" outlined></mwc-textfield>

It creates a nice input but without the attribute "name" attached to it. If I use the following:

<mwc-textfield class="w-100" label="Username" outlined name="username"></mwc-textfield>

This containing element has name="username" and the shadow-element also has name="username". Upon submit, the first name="username" (the mwc-textfield element) populates the value for "username" which is "None".

Is there a way to either add "Name" to the input only or manually create the template for this? If I copy/paste the shadow element HTML, it does not have the proper styling.

initplatform commented 3 years ago

Do you need to also set the value attribute? The docs for mwc-textfield say that the name attribute doesn't transmit to validation?

https://www.npmjs.com/package/@material/mwc-textfield#user-content-api

Also, be sure you are not running into [#25]