Zope ZPT Hourly Time selection dropdown

An example that presents a time selector dropdown with hourly options.
<div class="field">
	<label>Time</label>
	<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>
		</tal:block>
	</select>
</div>
Posted by
Snippet Viewed 1018 times.

Share your Zope ZPT code snippets:

  • Get some recognition & link back to your site.

 

Submit | Browse

Most Recent zope zpt snippets

Most Viewed