0

I've seen something similar on these links:

Multiple forms in a single page using flask and WTForms

django submit two different forms with one submit button

but a little bit diffirent (it's only a simple exercise), is there any simple way to do it ?

(I must not use them in the same form)

my template:

<form action="/example" autocomplete="on" method="post">
 <input placeholder="Enter a string" name="search">
 <input type="submit" value="send" name="btn">
</form>

<form action="/example" autocomplete="on" method="post">
 <select name="metods">
    <option value="a">a</option>
    <option value="b">b</option>
    <option value="c">c</option>
 </select>
</form>
Community
  • 1
  • 1
Yardi
  • 101
  • 8

1 Answers1

2

Thank you very much for responding. the exercise request that select and send button must be in different html forms.

I've just found how to resolve it, using HTML5 power xD. I needed only to give the form an id and then I affect it to the outsider element which is my select.

 <form id="myform" action="/example" autocomplete="on" method="post">
   <input placeholder="Enter a string" name="search">
   <input type="submit" value="send" name="btn">
 </form>

 <select name="metods" form="myform">
   <option value="a">a</option>
   <option value="b">b</option>
   <option value="c">c</option>
   </select>
Yardi
  • 101
  • 8