title: Not getting selected radio button value from one HTML form to another in Python Flask
body: <p>I have a home page with radio buttons. I select an item (database type) and want to get the checked-value in python code and then after some validation want to display another form to connect to the selected database type. But after trying so many things, I am unable to get the selected-radio-button value and then unable to process conndb.html below. I am quite new to Python web development. Not getting anything working to meet this requirement. Home page pyhton code is  </p>
  
  <pre><code>@bp.route('/')
  def index():
  db = get_db()
  if request.method == 'GET':
      posts = db.execute(
              'SELECT id, DB_Tp'
              ' FROM DB_Type'
              ' ORDER BY DB_Tp ASC'
              ).fetchall()
  
      error = None
      if len(posts) == 0:
          error = 'No Database Type To Choose For Meta Data. Create New Entry'
          flash(error)
  
      return render_template('meta/index.html', posts = posts)
  else:           **#=&gt; from here the code is never executed. It always falls thru to next function**
  
      checked = request.form['dbtype']
      print("This is ", checked, flush = True)
      if checked == "MySql":
          return render_template('meta/conndb.html')
      else:
          error = "Nothing checked "
          flash(error)
          return redirect(url_for("meta.index")) 
  </code></pre>
  
  <p>index.html is -</p>
  
  <pre><code>{% extends 'base.html' %}
  
  {% block header %}
    &lt;h1&gt;{% block title %}Select Database Type{% endblock %}&lt;/h1&gt;
  
  {% endblock %}
  
  {% block content %}
     &lt;form class="post" action="/conndb"&gt;
  {% for post in posts %}
      &lt;label class="body"&gt;
      &lt;input type="radio" name="dbtype" required&gt;{{post['DB_TP']}}&lt;/label&gt;&lt;br&gt;
  {% if not loop.last %}
  {% endif %}
  {% endfor %}    
      &lt;button type="submit"&gt;Next&lt;/button&gt;
  &lt;/form&gt;
  &lt;hr&gt;
  {% endblock %}
  </code></pre>
  
  <p>Depending on the selected radio button, I want to perform different operations with different kind of DB. After getting the value from the selected radio button, I render this template to connect to database...
  conndb.html</p>
  
  <pre><code>{% extends 'base.html' %}
  
  {% block header %}
     &lt;h1&gt;{% block title %}Provide Details To Connect To Database{% endblock %}&lt;/h1&gt;
  {% endblock %}
  
  {% block content %}
   &lt;form method="post"&gt;
   &lt;label for="host"&gt;Host Name&lt;/label&gt;
   &lt;input name="host" id="host" required&gt;
   &lt;label for="user"&gt;User ID&lt;/label&gt;
   &lt;input name="user" id="user" required&gt;
   &lt;label for="passwd"&gt;Password&lt;/label&gt;
   &lt;input type="password" name="passwd" id="passwd" required&gt;
   &lt;label for="db"&gt;Schema&lt;/label&gt;
   &lt;input name="db" id="db" required&gt;
   &lt;input type="submit" value="Get MetaData"&gt;
   &lt;/form&gt;
  {% endblock %} 
  </code></pre>
  
  <p>Any help is greatly appreciated.</p>