简体   繁体   中英

Extract django multi-select form choice

I want to reload part of my page upon form submit. To do this i´d like to extract the selected fields from a Django multiselectfield. Now I´m kinda stuck because Django renders the form like this:

在此处输入图片说明

Instead of select-Tags. How can i extract which choices have been selected? Or is there any way to return new information when the form has been selected without leaving the page?

You get the value in exactly the same way as for any other form field: via form.cleaned_data . In this case, form.cleaned_data['Messwerte'] .

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