Hi!
I have a html form in my default view. I don't want to create form
elements from my controller, but use pure HTML where possible. How can
I
1. Access the form elements, and their values into my controller, say
default.py. (something like GetElementById )
2. Detect if the form has been submitted, so that I can use the values
I Accessed.
I went through many questions here, but couldn't work it out.
My View:
<form id="mainForm" class="well form-search">
<legend>Search Videos</legend>
<span class="input">
<input type="text" size="45" name="search_keyword"
id="searchKeyword" class="xlarge">
</span>
<span class="formactions">
<button class="btn primary" type="submit">Search</
button>
</span>
</form>
My Controller:
def index():
# is form submitted ?
# if Yes
# Access the form
# get the value inside the searchKeyword text box
# Use it elsewhere
# else
# display the form and wait
I have a feeling that this is not the correct approach. Please feel
free to point me in the right direction.
Thank You.