title: flask forms and javascript
body: <p>hello i have the html code below</p>
  
  <pre><code>&lt;form&gt;
  &lt;input type="text" id="filepathz" size="40" placeholder="Spot your project files"&gt;
  &lt;input type="button" id="spotButton" value="Spot"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>the javascript code </p>
  
  <pre><code>  window.onload = init;
  
    function init() {
            var button = document.getElementById("spotButton");
            button.onclick = handleButtonClick;
    }       
  
    function handleButtonClick(e) {
            var filepathz = document.getElementById("filepathz");
  
           var path = filepathz.value;
  
           if (path == "") {
                   alert("give a filepath");
           }else{
                   var url = "http://localhost:5000/tx/checkme/filepathz=" + path;
                   window.open (url,'_self',false);
           }       
   } 
  </code></pre>
  
  <p>and the python code on flask</p>
  
  <pre><code>def index():
          """Load start page where you select your project folder
          or load history projects from local db"""
          from txclib import get_version
          txc_version = get_version()
          prj = project.Project(path_to_tx)
  
          # Let's create a resource list from our config file
          res_list = []
          prev_proj = ''
          for idx, res in enumerate(prj.get_resource_list()):
                  hostname = prj.get_resource_host(res)
          username, password = prj.getset_host_credentials(hostname)
          return render_template('init.html', txc_version=txc_version, username=username)
  
      @app.route('/tx/checkme/&lt;filepathz&gt;')
      def checkme(filepathz):
              filepathz = request.args.get('filepathz')
              return render_template('init.html', txc_version=filepathz)
  </code></pre>
  
  <p>what am i doing wrong and can't get the data from the form (filepathz) &lt;--- i get None </p>