简体   繁体   中英

why is web2py custom form, submitting even without {{=form.custom.submit}}?

I don't know what is happening, but my form is submitting even without the {{=form.custom.submit}} code.


        {{=form.custom.begin}}
            <div>{{=form.custom.widget.id}}</div>
            <div>{{=form.custom.widget.details}}</div>

            <div id="submit"><button></button></div>
        {{=form.custom.end}}

Take note that only <div id="sc"><button></button></div> is what I put.

What is happening, please tell me how to fix this.

The default type for button elements is "submit", so your button tag acts as a submit button. If you don't want it to act as a submit button, than explicitly set its "type" attribute to something other than "submit", such as "button" or "reset".

<button type="button"></button>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM