Hello,
I've been working with web2py controllers to connect with my database and I
haven't use views so far, so I don't know if what I'm trying to do is very
wrong. In that case, please, tell me ;-).
Suppose I have this:
controllers/mycontroller.py:
def show_matches():
matches = db(db.matches.id > 0).select()
return dict(matches=matches)
views/show_matches.html:
{{extend 'layout.html'}}
<h1>MATCHES</h1>
<table>
<th>
<th>MATCH</th>
<th>TEAM1</th>
<th>TEAM2</th>
</th>
{{for match in matches:}}
<tr>
<td>{{=match['team1']}} vs. {{=match['team2']}}</td>
<td>
<forms>
<select style="width:80px;">
<option>0</option>
<option>1</option>
<option>2</option>
<option>+2</option>
</select>
</form>
</td>
<td>
<forms>
<select style="width:80px;">
<option>0</option>
<option>1</option>
<option>2</option>
<option>+2</option>
</select>
</form>
</td>
</tr>
{{pass}}
</table>
I would like to include a button (with 'a' and 'onclick' I guess) at the
bottom of the page so when the user clicks in it, all data selected in the
forms are sent to mycontroller.py (to store_results_in_ddbb function).
How could I read all this data and send it to a controller? Should I have
only one <form> and all <select> components pointing to it through a 'form'
tag? Should I have all select components with an 'id' tag and read the data
through this tag?
I'm a newbie with HTML (web frontend in general) so I hope I am not saying
something very stupid ;-).
Any idea will be very appreciated.
Thank you very much and kind regards!
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.