[Moin-user] forms for moin

Craig Johnson CPJohnson at edcon.co.za
Tue Sep 19 03:49:19 EDT 2006

 like it, a lot. 
I tried something similar, but as a series of macro calls.  Ended up
being a big mess, this looks much cleaner.  I also tried to update the
contents of the Wiki Page from the action, which ran into issues with
the caching mechanism.
Why not make the form processor a user written Moin Action, rather than
some arbitrary CGI script?


	From: moin-user-bounces at lists.sourceforge.net
[mailto:moin-user-bounces at lists.sourceforge.net] On Behalf Of Matthew
	Sent: 19 September 2006 12:51 AM
	To: Craig Johnson
	Subject: [Moin-user] forms for moin

	I've started writing a parser for moin that will display forms.
	brief, it works like this:
	... form description here ...
	Because of this, it can be embedded in a normal wiki page so it
can be
	surrounded with other wiki content. The magic is in the form.py
	parser. It reads the contents of the form section and uses that
	generate the HTML for the form fields.
	I'm hoping to finish this tomorrow (Sept 19th, I'm GMT -5) by
the end
	of my work day, but I thought I should toss out what I'm doing
here in
	order to get feedback.
	First, here is what it won't do: It will *not* process the form.
	instead, either an action needs to be created for the form to be
	processed (which I plan to do, but separately) or you need to
	it to some other cgi/servlet/whatever.
	This code is only for displaying the forms.
	It works like this, inside the {{{}}} section will be a number
	lines. Each line represents one form field. The form fields will
	shown in the order they are declared. The available form fields
	 * text (plain text)
	 * e-mail (just like plain text, but with validation code)
	  * url (again)
	 * password - also, the ability to have two password fields that
	match each other
	  * text area (multiline plain text) - maybe with the option to
	it into a wysiwyg, possibly using dojo cf:
	 * section/separator - a heading for logically grouping form
elements together
	  * select list (option for multi select)
	 * check boxes
	 * radio buttons
	 * hidden field
	Each field has in common the following attributes:
	 * required = possible values yes/no/true/false/t/f/0/1
	  * cssclass
	 * id
	 * label
	 * extra information
	 * default value (can be from a cookie, not yet implemented
	 * name (obviously)
	And under consideration
	  * onfocus,onchange,etc - this would be disabled by default,
	turned on in wikiconf. If you had a public wiki, untrustworthy
	could put mean javascript there. I'm not sure I'm going to use
	but I can see how it would be handy
	  * adding a captcha field type
	Here's the syntax. The first line always describes the form.
	that, anything goes. Each line is a number of columns, separated
	field type | options | name | label | default value | sub items
	extra information
	Here's an example form:
	text|required=t|name|Your Name
	email|required=t|email|Please enter your e-mail address
	subject||subject|Subject|Help Request
	textarea|cssclass=wide|msg|Type your message here
	section|||Optional Information
	Sorry about the wrapping.
	I've implemented code like this before in two different systems,
	in PHP, another in XSL.
	Each time I implement it, I do it a little better. If you have
	feedback, I'd love to hear it.
	Matthew Nuzum
	newz2000 on freenode
	Take Surveys. Earn Cash. Influence the Future of IT
	Join SourceForge.net's Techsay panel and you'll get the chance
to share your
	opinions on IT & business topics through brief surveys -- and
earn cash
	Moin-user mailing list
	Moin-user at lists.sourceforge.net

This message is subject to certain restrictions and qualifications which are contained in our email disclaimer which is available on our website at www.edcon.co.za/Edcon/Disclaimer or from the Group Secretary on (011) 495-6000.
The disclaimer also provides our corporate information and names of our directors as required by law.
The disclaimer is deemed to form part of this message in terms of Section 11 of the Electronic Communications and Transactions Act, 2002.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/moin-user/attachments/20060919/046e0a86/attachment.html>

More information about the Moin-user mailing list