Input-Talk

Input

Talk, Questions, Comments & Ideas about PmWiki's Input form markup'''

Add new comments at the top here!


How can I use forms to do simple calculations?

I am trying to get the input variable from an input form. Do a calculation and output the result within a wiki page.

(:input form:)
(:input text name=timestamp: value="" size=30:) <--Get the user inputed timestamp variable from the form
(:input end:)

{(ftime '%b %d, %Y %I:%M %p' "-timestamp: seconds" )} <-Then Subtract the timestamp No from the current system time.

How can I specify which of several fields gets the cursor when the form is first displayed? Background: I'm adding AuthUser to my previously password-only authentication wiki, so most logins are password-only though the name field is required for AuthUser functionality. To avoid confusion among users, I have put the password field they already know on top of the page and added a comment that the name field can be left blank, but the cursor does not go into the first field as expected, but into the name field though I have moved it down. Any ideas? Thanks in advance! --Henning September 15, 2006, at 08:44 AM


Actually, we are working on a recipe that will do this and much more as we speak. It should hopefully be up before too long. It will be called FAST Data or something like that. Keep your eyes peeled on the maillist. When it's up, I'll come back here and update this note. Cheers! Caveman June 17, 2006, at 09:18 PM

The recipe is done. See FASTData?. You can use this to store the values of a form in a wiki page and retrieve them elsewhere. A full forms processing engine with some 20+ powerful features from emailing to logging to authentication and more. Also adds different pulldown menu and textarea markups. Enjoy! Caveman September 14, 2006, at 09:53 AM


Daniel, 13 June 06
Hello. Is it possible to store the values of a form? I don't need any processing possibilities. But what I select, i.e. with radio buttons or so, should stored within the wiki-page. Thanks! Daniel


I've contributed a general form processing engine for using PmWiki as a front end for a MySQL database. See UpdateForm. It also supports <select> tags and contents in <textarea>s. Ben Stallings June 02, 2006, at 09:25 PM


I have extended the original scripts/forms.php script to allow easy building of validated forms based on regular expression matching. See the article on my personal PmWiki for more details, an example and download. Jm March 22, 2006, at 01:39 AM


Cool. A thought on form processing. Have you considered some standard form processing elements? I had an idea about this. You include markup on the same wikipage which describes how to process the form. When you click submit, the page links to itself, but with action=submitForm in the URL. When the wiki page is read, it processes the form. After processing the form, the browser will be pointed to a new page, with a user message like "Processing Form" displayed for 5 seconds before the redirect.

For example, you could email the form to someone, (:process email "my@email.com":) or you could append the form data to a file (:process file "records.csv":) or even have the results appear on a new wiki page. (Yes there is an issue of how to format the form data on the page, ideas?).

Ok, it is easy to balk at making a general form processing engine. But at a minimum, emailing the form or writing it to a file are easy generally useful features.

Tom Carchrae, March 07, 2006, at 07:59 PM


This is great !
However, I miss the possibility to have a file upload to the server.
Something like this in html : <input type="file" name="attachment" size="40">
I am using pm wiki as a CMS, and need in order to pass it to a cgi script.
Is it possible ? ├ůsmund Realfsen, October 05, 2005


How do you specify how many radio buttons you want? Size doesn't seem to work.

Specify multiple radiobuttons with the same name. Joachim Durchholz September 04, 2005, at 04:01 PM


Publications list example

Hmmm.. The send button does open a mail browser, and in the mail I see a string of the three names in the form and the values I put in. The columns length does not seem to work here? And neither does line break, but I cant see why. halhal

(:input form "mailto:" :) 
Author: (:input text ex_list_author rows=1 cols=40:) \\ 
Year: (:input text ex_list_year rows=1 cols=4:) \\ 
Title: (:input text ex_list_title rows=1 cols=60:) \\ 
(:input submit value="Send":)
(:input end:)
Author: \\
Year: \\
Title: \\

The attribute for changing the length of a "text" control is "size" -- I don't know why HTML uses 'cols' for textarea and 'size' for text. In order for '\\' to work it must be the very last thing on the line (no spaces). Thus:

(:input form "mailto:" :) 
Author: (:input text ex_list_author size=40:) \\
Year: (:input text ex_list_year size=4:) \\
Title: (:input text ex_list_title size=60:) \\
(:input submit value="Send":)
(:input end:)
Author:
Year:
Title:

Talk page for the Input recipe (users?).