Is there a way to pass an additional list of parameters outside of a form when the form is submit?
I know I can create a new hidden input field in the form for each parameter I want to pass through the form, but is there another way? I tried to add parameters directly to the form action but that doesn't work. The code in its entirety can be found here:
from flask import Flask, request
import os
app = Flask(__name__)
@app.route('/')
def index():
print request.args
return "<form action='/?foo=bar'><input name='variable' type='text' /></form>"
if __name__ == '__main__':
port = int(os.environ.get('PORT', 8080))
app.run('0.0.0.0', debug=True, port=port)
Clarifying question based on feedback from comments:
Using this code, when I type "123" into the textbox and hit enter, I see that the url is http://my-workspace.c9users.io/?variable=123.
What I want is http://my-workspace.c9users.io/?foo=bar&variable=123.