Zope ZPT Hourly Time selection dropdown

An example that presents a time selector dropdown with hourly options.
<div class="field">
	<select name="time" tal:define="options python: [str(item) + ' AM' for item in range(5, 12)] + ['12 PM'] +  [str(item) + ' PM' for item in range(1, 9)]">
		<option value="">Choose One</option>   
		<tal:block tal:repeat="option options">
			<option tal:content="option" tal:attributes="value option; selected python:test(request.get('time','') == option, 'selected', '');"></option>
Posted by
Snippet Viewed 1238 times.

Share your Zope ZPT code snippets:

  • Get some recognition & a link back to your site.
  • Create your own code library.
  • Help your fellow developers, as they have helped you.


Submit | Browse

Most Recent zope zpt snippets

Most Viewed