This page explains how you can embed input forms into wiki pages.
Input forms capability became standard after 2.0.beta44, and further improvements to forms processing can be found in the Cookbook (see below).
Input forms don't actually handle any processing of the form data -- it simply allows creation of forms inside of wiki pages. However, it is extensible and makes it possible for the wiki administrator to create custom form elements (see the example of edit page elements below).
Markup
This recipe defines an (:input:) markup which can be used to create a variety of form controls. For most controls the markup has the form
(:input type name value option=value :)
where type is the type of input element (described below), name is the name of the control, value is its initial value, and options are used to specify additional attributes to the control. For example, the following creates a text input control with a size of 30 characters:
For convenience, an author can also specify name and value arguments directly using name= and value= attributes (same as HTML):
Form markups
Two directives are used to begin and end forms:
(:input form "url " method :)
...
(:input end:)
The (:input form:) directive starts a form that will post to url using the supplied method . The url must be in quotes. If the url is omitted, then the current page is assumed. If method is omitted then "POST" is assumed. The (:input end:) directive ends the current form.
Note that this recipe doesn't (yet?) make any attempt to ensure that the form output is correct HTML -- it assumes the author knows a little bit of what he or she is doing.
Standard input controls
The standard input controls are:
(:input text name value size=n :)
(:input hidden name value :)
(:input password name value :)
(:input radio name value :)
(:input checkbox name value :)
(:input select name value label :)
(:input default default-name default-value :)
(:input submit name label :)
(:input textarea name value rows=n cols=n :)
(:input reset name label :)
(:input file name label :)
(:input image name "src" alt :)
Where name and value are in the HTML syntax: name="addr" value="808 W Franklin"
For the textarea control a value can be set from PmWiki 2.2.0beta45 onwards.
The submit control will more often be written as:
(:input submit value=label :)
Example
Here's a more complete example, e.g., for a login prompt:
(:input form "http://www.example.com":)
(:input hidden action login:)
|| Name:||(:input text username:) ||
|| Password:||(:input password password:)||
|| ||(:input submit value="Log In":) ||
(:input end:)
Page edit controls
This feature also defines a number of custom types for implementing page edit controls. These are (more are forthcoming):
(:input e_form:)
(:input e_text rows=n cols=n :)
(:input e_save:)
(:input e_saveedit:)
(:input e_cancel:)
(:e_preview:)
(:input e_minor:)
(:input e_author:)
However, they only display as controls when viewed with ?action=edit.
Thus, an edit page could be formatted with something like:
!!Editing {$FullName}
(:input e_form:)
(:input e_text rows=5 cols=40:) \\
Author: (:input e_author:) (:input e_minor:) This is a minor edit \\
(:input e_save value="$[Save]" :) (:input e_preview value="$[View Pre]":)
(:input end:)
Editing PmWiki.Forms
(:input e_form :)
(:input e_text rows=5 cols=40:) Author: (:input e_author :) (:input e_minor :) This is a minor edit (:input e_save value="Save" :) (:input e_preview value="View Pre":)
Custom input controls
This feature also allows wiki administrators to design custom input controls through the $InputTags array. Documentation of this feature will be forthcoming.
See for a custom input tag for instance: Cookbook:InputJumpBox
Example: Input text box which clears a value set when clicked (using script with onfocus event):
Add to your local config file:
# input text box will keep initial value, unless name contains '-clear'
$InputTags['text'][':html'] = "<input type='text' \$InputFormArgs
onfocus=\"if(this.name.indexOf('-clear')!=-1) this.value=''\" />";
Now if you want an input textbox, which will be cleared when clicking it, add to the name '-clear', like:
(:input text box1-clear "Value will clear":)
Or alternatively add to local config:
# input text box will clear initial value, unless name contains '-fix'
$InputTags['text'][':html'] = "<input type='text' \$InputFormArgs
onfocus=\"if(this.name.indexOf('-fix')==-1) this.value=''\" />";
Now any textbox will clear when clicked, unless its name contains '-fix', like:
(:input text box2-fix "Value will stay":)
(:input auth_form:)
When someone hits "Save" on a page, we don't want to lose their edits so, any variables that are posted as part of the save get preserved in the AuthForm, so that when they send the password it's just like they were re-posting the page
This is used in Site.AuthForm . Basically it's <form action='{$_SERVER['REQUEST_URI']}' method='post' name='authform'>\$PostVars where $PostVars is a sequence of <input type='hidden' name='...' value='...' /> tags that encode whatever was posted when the auth_form was generated. Essentially $PostVars takes the contents of $_POST and submits them as part of the auth form.
(:input select ... :)
This page (largely reproduced below) is testing the new (:input select ... :) markup in forms, as well as testing the ability to retain values across form submissions.
We'll start with (:input select ...:). The basic form of a select box is a sequence of options:
(:input form:)
(:input form:)
(:input select name=abc value=1 label=alpha :)
(:input select name=abc value=2 label=beta :)
(:input select name=abc value=3 label=gamma :)
(:input submit:)
(:input end:)
Or, the values can be specified positionally:
(:input select name=abc 1 alpha :)
(:input select name=abc 2 beta :)
(:input select name=abc 3 gamma :)
alpha beta gamma
We can specify the size of the selection box:
(:input select name=abc 1 alpha size=3 :)
(:input select name=abc 2 beta :)
(:input select name=abc 3 gamma :)
alpha beta gamma
The "multiple" option works:
(:input select name=abc 1 alpha size=3 multiple:)
(:input select name=abc 2 beta selected=selected:)
(:input select name=abc 3 gamma :)
alpha beta gamma
So, here's a dropdown list of pages in the Test group:
(:if false:)
[[#dropdownlist]]
(:input select name=n {=$FullName} "{=$Name}":)
[[#dropdownlistend]]
(:if:)
(:pagelist fmt=#dropdownlist group=Test:)
12Over4 2003Titlespaced 2006-01-01 20060308 20070402-Draft 20070417 20070417-Draft 20070809 20070809-AnotherTest 20070905 20071019-SomeHybridPageName 20071107 20090101-HappyNewYear 20090110 Abc2 AbcMusic Abilità Accented Accented-Talk AccessKeyToEdit AccueilTest AddLinkBookmarklet AdminConference2007-05-11 AdvancedTable AdvTable AllowPassword AlternativeViewProposal AmanitaPantherina Ampersand AmpersandTitle AmpersandTitle2 AnchorSpacing Arrow Attach AttachAttach AttachDelta Attached AttachExample AttachExample2 AttachExist AttachList AttachWithSpaces AttachWithText AttrExample AuthConditions AuthHeader AuthList AuthList2 AuthListShort Author AuthorContributions AuthorCookie AuthorLink AuthorRequired AuthPw AuthUser BackgroundImage BackgroundImages Backlink Backlink-aux Backlinks BackLinks Backlinks2 Banner Bar BaseA BaseB BaseC BaseName BasicAuth BensonHedges BGColor BigBigSummary BigEdit BigWithInclude BigWithInclude2 BISyntax BlankLines Block-In-A-Div Blocklist Blocks BoldOrderedList BooklikeParagraphs Bookmarklet BorderColorImg BoxCode Bridge Bridge2 BrowserCondition BrowseTrail BugOrFeature BugWithInclude1 BugWithInclude2 Button BWSS BWSSMeeting Calendar CamelCasedLinks Captcha CategoryPV CategoryRequired CategoryTestPageWithoutLink CategoryUploadDummy CategoryUploadsDummy CategoryUploadsDummy2 CCLicense CellCenter CenteredBlock CenteredInterMapImage CenterHeading CFrame CheckBoxArray Chess ChessMarkup ChopTitle Christian Cjc Codeblock CodeTest ColumnLists ColumnPageList ColumnSpanning CommandPrompt Commentary CommentFormat Comments CommentsTargets CondAuth CondExists CondExtend ConditionAction ConditionalStatementsAndVerticalSpace Conditions Confluence ContentTemplate ConvertAccentedChars CookbookColumned CookbookList CountGlyphs CreatedFile CreatedMarkup CreateLinkTests CreateTime CreativeCommons Creole Creole-Sandbox CrossGroupTrail CSS CSSMarkup CssMarkup2 CSSPopups CtimeCookbookList Danger DataVars DateConditional DateMgtAndConditionals DateRange DC DC-Draft DefinitionLists Definitions Definitions2 Delete DeletedPage DeletedPageList Description DescriptionT DevelMarkup Dfaure DiffAuthor DirectiveAndText DirectiveAndText2 DisableMarkup DisplaysInLists Divend DivMarkup DivMarkup-Draft DivMarkupBug Divs DivTemp DMarkup DocumentationXref DoubleDiv DoubleSave DropDown DublinCore DuplicateMailPosts DynamicImage EasyGallery EasyGalleryPic1 EasyGalleryPic2 EasyGalleryPic3 EasyGalleryPic4 EasyGalleryPic5 EasyGalleryPic6 EasyGalleryTemplate Editform EditForm Editform-edit EditForm2 EditForm3 EditForm4 EditFormWrapDiv EditFromPmwiki-mode-Draft EditNoLeft Editor EditPreview EditPreviewForm EditQuickReference EditRedirect EmptyLink EmptyList EmptyPage EmptyTargets Enabled EnableHTML Equality Events ExcelPaste ExtendMarkup ExternalLinks ExternalLinkWithLineContinuation ExtractList ExtractListFailure FAQ FAQClassic FAQTemp FileList FileManagers FileMarkup FileUrls FilmScript Flash Float Float2 FloatBreak FloatDiff FloatHistory FloatingColumns FloatingImage FloatLeftInItem FmtCount FontStyles Foo FormatingBugs FormListTemplate FormPTVTest Forms ForumForm ForumList ForumTemplate FPLByGroup FPLCount FPLMySimple FPLTemplate Fractions Frame FrameCenter Frames FromHomePage Ftime FtimeInPagelist FTimeMarkup FullScreenPage FunWithTables GeminiThemes GeminiThemes1 GeminiThemes2 GeminiThemes3 Gimg GlobalVarSubstitutions GoogleChart GoogleSearch GroupAttributes GroupHome GroupListing GroupOnlySyntax GroupTitle GroupTitles GUIButtons HardPageBreak HasPreformattedLine HeadingAndPre HeadingNoTitle HeadingsWithText1 HeadingsWithText2 HeadingsWithText3 HeadingsWithText4 HeadingsWithText5 HighlightAction HighlightRows Hojdare HolaMundo HomeList HomePage HomePageLink Html HTMLCache HTMLStyleFmtOverride HTMLValidationWithIncludes HTMLValidationWithIncludes-help1 HTMLValidationWithIncludes-help2 Höjdare IfAuthTest IfDate IfElseIf ImageBorder ImageBorders ImageCaption ImageFloat ImageFrameTest ImageLines ImageLink ImageNameWithSpaces Images ImagesTemp ImageTable ImageTest ImageThumbLink ImageThumbLink-Img1 ImageThumbLink-Img2 Include Include2 IncludeBugA IncludeBugB IncludeBugWithLabel IncludeBugWithLabelSrc IncludedPage IncludedStyleDefinitionInCamelCase IncludeFromComment IncludeFromOther IncludeFromSelf IncludeFromSelfPage IncludeFromSelfPage2 IncludeLength IncludeLength2 IncludeLinksTest IncludeLinksTest2 IncludeOneLine IncludeOneLineSrc IncludeRestOfPage IncludeSamePage IncludeSelf IncludeTest1 IncludeTest2 IncludeVarTest IncludeVarTestBase IncludeWithBasepage IncludeWithoutNewline IncludeWithPTV IncludeWithPTV2 IncludeWithPTVTemplate IncludingPage IncorrectIndentation Indent IndentParas Indents IndentStyle Infobox InlineBreaks InlinePageList InlinePHP InputDefault InputDefaults InputForSelectingPage InputSelect InputSelectJiri InputSelectNestingSource InputTextareaDefault Insert InterMap InterMapLinks InternationalAuthor ItalicsInTitle ItemListWithHorizontalSpace ItemListWithSpecialStyling JSFeed JsMath JumpBox JumpTop Justify JustText KeepKeep KeepMarkup Keywords Kmarie LargePage LastModifiedHost LatestNews Latestnews-Draft Layers LB LeftBar LightSkinEditPage LinebreaksAndWhitespacePre LineContinutation1 LinesWithSpaces LinkHTMLOutput LinksToSomePage LinksWithDash LinkTest LinkTitle LinkTitles LinkToGroup ListAndPreformat ListBasicAudiencePages ListCategoryMatchingTwoCategories ListId ListPagesWithoutACategory Login Logout LongCodeLine LongLinkText LongListItems MacIE52ScreenShots Macron MailForm ManuallySetEnumeratedLists Map Markup MarkupCharacters MarkupExpr Markups MarkupTricks Math122-200702 MaxPostSize MediaWiki MenuBar MetaKeywords Metaphors MissingCSS ModuleGuidelines-Old MonospaceWordWrap MoreStyles MultiLang MultilineList MultiLinePageTextVariables MultipleLinePTV MultiUrl MyTest NameISOWeek NarrowContent NestedVars NestTableAndDiv NewCleanUrlsRecipe NewDefSkinMod Newline NewPageBox NewRecentChanges News NextEventAnchor NoAction NoBold NoChars NoEditLinks NoFlash NoFooterPage NoHeaderPage NoHostLogging NoLeftPage NoNestTest NonExistentTitles NonTrailPage NonTrailPage2 NoQuest NoRightPage NoSummaryPages Note Notebook-NT-Skin Notebook-NT-Skin-LeftFloat Notify NumArticles NumberedLists NumericPassword OldAl OneLineTemplate OnlinePresence Opacity OSM OutlineTest Overflow PageCount PageExists PageIndex PageList PageList2 PageList3 PageList4 PageListAnchors PagelistBug1 PageListCache PageListCalls PageListCount PagelistCount PagelistDescriptionFormat PagelistExample PageListFmt PageListFmtGroup PagelistFmtGroupsWithLinksToListPage PageListIf PagelistLink PageListLinks PageListLinkWithPtv1 PageListLinkWithPtv2 PageListLinkWithPtv3 PageListLinkWithPtv4 PageListLinkWithPtv5 PageListOptions PageListOrderingWithPgVar PageListRecent PagelistRecentChanges PageListSelf PageListTemplate PageListTemplates PagelistTemplateSamples PageListTest PageListTime PageListTitles PageListTItleSpaced PageListTrail PageListTrail2 PageListTrail3 PageListTrailNot PageListWithPgVar PageListWithPgVar1 PageListWithPgVar2 PagelistWithUndefinedFormat PageNameCases Pagenamecases2 PageNameWithPmWikiInIt PageNotFound PageNäme PagePaths PagesInPmWikiGroupWithRedirect PagesLastModifiedByYou PageSource PageTextVariables PageVarSelection PageWithEntity PageWithLotsOfText PagewithOnlyPagelist PageWithTeaser PaPa Paragraph ParaIndent ParseArgs PasswdList Password PasswordAndEmacs PasswordProtectedPage PData Pdf PITSList PL PLC PLTVarOption PmCal PmCal-Examples PmCal-Examples2 PmSlide PmWiki PMWiki Podcast PopUp PopUpTrimmed PostStopWatch PreFmtNotWorking Preformat Preformatted PreformattedBlock PreformattedBlock2 PreformattedText PreformattedTextAndTAB PreOverflow Present PreSpaces PreValidate PreviewChange PreWithFormatting PreWrap PrintSkin Printtest ProfileBug ProfileList Properties Ptest PTV Ptv PTV-Petko1 PTV-Petko2 PTV-Petko3 PTV-Petko4 PTV-Petko5 PTV-Petko6 PTV-Summary PTV2 PTV3-Draft PTVarEscape PTVbug PtvMaybe PtvMayBe PtvNo PtvNO PtvSome-Times PtvSomeTimes PtvTemplate PTVWithPageList PtvYES PtvYes PurpleCow PWAd PwdEditImpliesRead QueryString Quicktoc Quienc QuotesInLinks RadioButtons Rand RandomPageList RaphaëlÊtreInouï RatingByAuthor RB05Week14 ReadPass ReadProtected ReallyReallyReallyLongPageName ReallyReallyReallyLongPageName-noItIsReallyExtremelyLong ReallyReallyReallyLongPageNamenoItIsReallyExtremelyLong ReallySimple RecentChanges RecentChanges RecentChangesByDate RedirectAnchor Refresh RelativeLinksPagelist RelLinks Renamepage-Draft RevMarkup Rfloat RightBar RightFloat RightLink Rollover RotateMarkup RowStyling RSSFeedLinks RTL SafeModeGID Sandbox Sandbox-Draft Sandbox2 Search SearchBox SearchBox2 SearchBoxArgs SearchBoxInclude SearchBoxPageList SearchBoxTrail SearchByTitle SearchCloud SearchForm SearchResults SearchResultsWithCateogory SearchSort SearchTerms Sections SelectPageSpaced SelfTarget ShouldWork SideBar Sidenotes Simple SimpleViewer SimultaneousEdits SimultaneousEdits1 SiteAdminProposal SiteGroupMarkup SiteMap SkinChange SkinList SkinMarkup Skins SkinTestAssortment SkinTestCompact SkinTestHeadings SkinTestImages SkinTestLists SkinTestLongPre SkinTestMenu SkinTestSelectSkin SkinTestTables SkinTestText Skype SlideShow SloveneSearch SmallCaps SomePage SpacedLinks SpacesInSimpleTables SpaceWikiWord SpaceWikiWords Spacing SpanInLink SpecialLinks SSWB Start StickyNotes StickyNotes1 Sting StmLink Stubs StyleClass StyleInLinkText Superscripts TableBackground TableBorders TableBug TableCellSpace TableDirectives TableTest Tabs Tags Template TemplateLinks Templating Terminology Test Test123 Test2 TestCache TestData TestDe TestDirectiveMarkup TestGroup TestLP Testm TestStyles TestToC TestÄöü Text TextArea TextareaFontTest TextTransform TextVars ThickBox Title TitleLinkWithQuery Titlespaced2004-05-08 TitleTest Tjolahoppsan TmpFeed TmplDisplay TOC1 Tooltips Top10NotRecentlyModified Topic1 TopNav Trail3 TrailFromPagelist TrailIndex TrailPage1 TrailPage2 TrailPage3 TrailPage4 TrailPath Umlauts UmlautUploads UploadForm Uploading UploadSimpleForm UploadsQuickReference URL UrlApprovals UrlError UrlParens UrlsWithDates UrlWithQuotes UserAndLevel UseTable UsingTabForPreformattedText VariablesAndFriends VerticalSpace VerticalSpacing1 VeryLongLinkText VoteOnFirstLastMarkup VoteOnLeadingWhitespace VoteOnLeadingWhitespace-Talk VoteOnNestedDivMarkup VoteOnNestedDivMarkup-Talk VoteOnSiteHeader VoteOnSiteHeader-Talk Voting Weird Whitespace WhitespaceRules WidthAttr WikiDefines WikiStyle WikiStyleClass WikiStyleDefines WikiStyleInCamelCase WikiStylePercent WikiStyleRED WikiStyleRight WikiStyles WikiStyleToTheEnd Wikitest WikiTrail WikiTrail1 WikiTrail2 WikiTrail3 WikiTrail4 WikiTrail5 WikiTrailPagelist WikiTrails WikiTrailsDraft WikiWord WikiWord2 WikiWord3 WikiWordCount WikiWordsAndStyles WildcardLinkSyntax Wildcards WildcardSlash WindowsFileUrls Withattrib2 WithHtml WordLinks WordWrap Wrap WSExtra WSIndent WSIndent2 WSIndent3 WSPlusCode XLPageUpdate XMLTest XMLTest2 XYTrail XYTrail1 XYTrail2 XYTrail3 XYTrail4 XYTrail5 XYTrail6 ZAPMcode
A group page navigator:
>>display=none<<[@
[[#navigator]]
(:if equal {=$FullName} {*$FullName}:)
(:input select name=n selected=selected {=$FullName} "{=$Name}":)
(:if ! equal {=$FullName} {*$FullName}:)
(:input select name=n {=$FullName} "{=$Name}":)
[[#navigatorend]]
@](:nl:)>><<
(:pagelist fmt=#navigator group=Test:)
[[#navigator]]
(:if equal {=$FullName} {*$FullName}:)
(:input select name=n selected=selected {=$FullName} "{=$Name}":)
(:if ! equal {=$FullName} {*$FullName}:)
(:input select name=n {=$FullName} "{=$Name}":)
[[#navigatorend]]
12Over4 2003Titlespaced 2006-01-01 20060308 20070402-Draft 20070417 20070417-Draft 20070809 20070809-AnotherTest 20070905 20071019-SomeHybridPageName 20071107 20090101-HappyNewYear 20090110 Abc2 AbcMusic Abilità Accented Accented-Talk AccessKeyToEdit AccueilTest AddLinkBookmarklet AdminConference2007-05-11 AdvancedTable AdvTable AllowPassword AlternativeViewProposal AmanitaPantherina Ampersand AmpersandTitle AmpersandTitle2 AnchorSpacing Arrow Attach AttachAttach AttachDelta Attached AttachExample AttachExample2 AttachExist AttachList AttachWithSpaces AttachWithText AttrExample AuthConditions AuthHeader AuthList AuthList2 AuthListShort Author AuthorContributions AuthorCookie AuthorLink AuthorRequired AuthPw AuthUser BackgroundImage BackgroundImages Backlink Backlink-aux Backlinks BackLinks Backlinks2 Banner Bar BaseA BaseB BaseC BaseName BasicAuth BensonHedges BGColor BigBigSummary BigEdit BigWithInclude BigWithInclude2 BISyntax BlankLines Block-In-A-Div Blocklist Blocks BoldOrderedList BooklikeParagraphs Bookmarklet BorderColorImg BoxCode Bridge Bridge2 BrowserCondition BrowseTrail BugOrFeature BugWithInclude1 BugWithInclude2 Button BWSS BWSSMeeting Calendar CamelCasedLinks Captcha CategoryPV CategoryRequired CategoryTestPageWithoutLink CategoryUploadDummy CategoryUploadsDummy CategoryUploadsDummy2 CCLicense CellCenter CenteredBlock CenteredInterMapImage CenterHeading CFrame CheckBoxArray Chess ChessMarkup ChopTitle Christian Cjc Codeblock CodeTest ColumnLists ColumnPageList ColumnSpanning CommandPrompt Commentary CommentFormat Comments CommentsTargets CondAuth CondExists CondExtend ConditionAction ConditionalStatementsAndVerticalSpace Conditions Confluence ContentTemplate ConvertAccentedChars CookbookColumned CookbookList CountGlyphs CreatedFile CreatedMarkup CreateLinkTests CreateTime CreativeCommons Creole Creole-Sandbox CrossGroupTrail CSS CSSMarkup CssMarkup2 CSSPopups CtimeCookbookList Danger DataVars DateConditional DateMgtAndConditionals DateRange DC DC-Draft DefinitionLists Definitions Definitions2 Delete DeletedPage DeletedPageList Description DescriptionT DevelMarkup Dfaure DiffAuthor DirectiveAndText DirectiveAndText2 DisableMarkup DisplaysInLists Divend DivMarkup DivMarkup-Draft DivMarkupBug Divs DivTemp DMarkup DocumentationXref DoubleDiv DoubleSave DropDown DublinCore DuplicateMailPosts DynamicImage EasyGallery EasyGalleryPic1 EasyGalleryPic2 EasyGalleryPic3 EasyGalleryPic4 EasyGalleryPic5 EasyGalleryPic6 EasyGalleryTemplate Editform EditForm Editform-edit EditForm2 EditForm3 EditForm4 EditFormWrapDiv EditFromPmwiki-mode-Draft EditNoLeft Editor EditPreview EditPreviewForm EditQuickReference EditRedirect EmptyLink EmptyList EmptyPage EmptyTargets Enabled EnableHTML Equality Events ExcelPaste ExtendMarkup ExternalLinks ExternalLinkWithLineContinuation ExtractList ExtractListFailure FAQ FAQClassic FAQTemp FileList FileManagers FileMarkup FileUrls FilmScript Flash Float Float2 FloatBreak FloatDiff FloatHistory FloatingColumns FloatingImage FloatLeftInItem FmtCount FontStyles Foo FormatingBugs FormListTemplate FormPTVTest Forms ForumForm ForumList ForumTemplate FPLByGroup FPLCount FPLMySimple FPLTemplate Fractions Frame FrameCenter Frames FromHomePage Ftime FtimeInPagelist FTimeMarkup FullScreenPage FunWithTables GeminiThemes GeminiThemes1 GeminiThemes2 GeminiThemes3 Gimg GlobalVarSubstitutions GoogleChart GoogleSearch GroupAttributes GroupHome GroupListing GroupOnlySyntax GroupTitle GroupTitles GUIButtons HardPageBreak HasPreformattedLine HeadingAndPre HeadingNoTitle HeadingsWithText1 HeadingsWithText2 HeadingsWithText3 HeadingsWithText4 HeadingsWithText5 HighlightAction HighlightRows Hojdare HolaMundo HomeList HomePage HomePageLink Html HTMLCache HTMLStyleFmtOverride HTMLValidationWithIncludes HTMLValidationWithIncludes-help1 HTMLValidationWithIncludes-help2 Höjdare IfAuthTest IfDate IfElseIf ImageBorder ImageBorders ImageCaption ImageFloat ImageFrameTest ImageLines ImageLink ImageNameWithSpaces Images ImagesTemp ImageTable ImageTest ImageThumbLink ImageThumbLink-Img1 ImageThumbLink-Img2 Include Include2 IncludeBugA IncludeBugB IncludeBugWithLabel IncludeBugWithLabelSrc IncludedPage IncludedStyleDefinitionInCamelCase IncludeFromComment IncludeFromOther IncludeFromSelf IncludeFromSelfPage IncludeFromSelfPage2 IncludeLength IncludeLength2 IncludeLinksTest IncludeLinksTest2 IncludeOneLine IncludeOneLineSrc IncludeRestOfPage IncludeSamePage IncludeSelf IncludeTest1 IncludeTest2 IncludeVarTest IncludeVarTestBase IncludeWithBasepage IncludeWithoutNewline IncludeWithPTV IncludeWithPTV2 IncludeWithPTVTemplate IncludingPage IncorrectIndentation Indent IndentParas Indents IndentStyle Infobox InlineBreaks InlinePageList InlinePHP InputDefault InputDefaults InputForSelectingPage InputSelect InputSelectJiri InputSelectNestingSource InputTextareaDefault Insert InterMap InterMapLinks InternationalAuthor ItalicsInTitle ItemListWithHorizontalSpace ItemListWithSpecialStyling JSFeed JsMath JumpBox JumpTop Justify JustText KeepKeep KeepMarkup Keywords Kmarie LargePage LastModifiedHost LatestNews Latestnews-Draft Layers LB LeftBar LightSkinEditPage LinebreaksAndWhitespacePre LineContinutation1 LinesWithSpaces LinkHTMLOutput LinksToSomePage LinksWithDash LinkTest LinkTitle LinkTitles LinkToGroup ListAndPreformat ListBasicAudiencePages ListCategoryMatchingTwoCategories ListId ListPagesWithoutACategory Login Logout LongCodeLine LongLinkText LongListItems MacIE52ScreenShots Macron MailForm ManuallySetEnumeratedLists Map Markup MarkupCharacters MarkupExpr Markups MarkupTricks Math122-200702 MaxPostSize MediaWiki MenuBar MetaKeywords Metaphors MissingCSS ModuleGuidelines-Old MonospaceWordWrap MoreStyles MultiLang MultilineList MultiLinePageTextVariables MultipleLinePTV MultiUrl MyTest NameISOWeek NarrowContent NestedVars NestTableAndDiv NewCleanUrlsRecipe NewDefSkinMod Newline NewPageBox NewRecentChanges News NextEventAnchor NoAction NoBold NoChars NoEditLinks NoFlash NoFooterPage NoHeaderPage NoHostLogging NoLeftPage NoNestTest NonExistentTitles NonTrailPage NonTrailPage2 NoQuest NoRightPage NoSummaryPages Note Notebook-NT-Skin Notebook-NT-Skin-LeftFloat Notify NumArticles NumberedLists NumericPassword OldAl OneLineTemplate OnlinePresence Opacity OSM OutlineTest Overflow PageCount PageExists PageIndex PageList PageList2 PageList3 PageList4 PageListAnchors PagelistBug1 PageListCache PageListCalls PageListCount PagelistCount PagelistDescriptionFormat PagelistExample PageListFmt PageListFmtGroup PagelistFmtGroupsWithLinksToListPage PageListIf PagelistLink PageListLinks PageListLinkWithPtv1 PageListLinkWithPtv2 PageListLinkWithPtv3 PageListLinkWithPtv4 PageListLinkWithPtv5 PageListOptions PageListOrderingWithPgVar PageListRecent PagelistRecentChanges PageListSelf PageListTemplate PageListTemplates PagelistTemplateSamples PageListTest PageListTime PageListTitles PageListTItleSpaced PageListTrail PageListTrail2 PageListTrail3 PageListTrailNot PageListWithPgVar PageListWithPgVar1 PageListWithPgVar2 PagelistWithUndefinedFormat PageNameCases Pagenamecases2 PageNameWithPmWikiInIt PageNotFound PageNäme PagePaths PagesInPmWikiGroupWithRedirect PagesLastModifiedByYou PageSource PageTextVariables PageVarSelection PageWithEntity PageWithLotsOfText PagewithOnlyPagelist PageWithTeaser PaPa Paragraph ParaIndent ParseArgs PasswdList Password PasswordAndEmacs PasswordProtectedPage PData Pdf PITSList PL PLC PLTVarOption PmCal PmCal-Examples PmCal-Examples2 PmSlide PmWiki PMWiki Podcast PopUp PopUpTrimmed PostStopWatch PreFmtNotWorking Preformat Preformatted PreformattedBlock PreformattedBlock2 PreformattedText PreformattedTextAndTAB PreOverflow Present PreSpaces PreValidate PreviewChange PreWithFormatting PreWrap PrintSkin Printtest ProfileBug ProfileList Properties Ptest PTV Ptv PTV-Petko1 PTV-Petko2 PTV-Petko3 PTV-Petko4 PTV-Petko5 PTV-Petko6 PTV-Summary PTV2 PTV3-Draft PTVarEscape PTVbug PtvMaybe PtvMayBe PtvNo PtvNO PtvSome-Times PtvSomeTimes PtvTemplate PTVWithPageList PtvYES PtvYes PurpleCow PWAd PwdEditImpliesRead QueryString Quicktoc Quienc QuotesInLinks RadioButtons Rand RandomPageList RaphaëlÊtreInouï RatingByAuthor RB05Week14 ReadPass ReadProtected ReallyReallyReallyLongPageName ReallyReallyReallyLongPageName-noItIsReallyExtremelyLong ReallyReallyReallyLongPageNamenoItIsReallyExtremelyLong ReallySimple RecentChanges RecentChanges RecentChangesByDate RedirectAnchor Refresh RelativeLinksPagelist RelLinks Renamepage-Draft RevMarkup Rfloat RightBar RightFloat RightLink Rollover RotateMarkup RowStyling RSSFeedLinks RTL SafeModeGID Sandbox Sandbox-Draft Sandbox2 Search SearchBox SearchBox2 SearchBoxArgs SearchBoxInclude SearchBoxPageList SearchBoxTrail SearchByTitle SearchCloud SearchForm SearchResults SearchResultsWithCateogory SearchSort SearchTerms Sections SelectPageSpaced SelfTarget ShouldWork SideBar Sidenotes Simple SimpleViewer SimultaneousEdits SimultaneousEdits1 SiteAdminProposal SiteGroupMarkup SiteMap SkinChange SkinList SkinMarkup Skins SkinTestAssortment SkinTestCompact SkinTestHeadings SkinTestImages SkinTestLists SkinTestLongPre SkinTestMenu SkinTestSelectSkin SkinTestTables SkinTestText Skype SlideShow SloveneSearch SmallCaps SomePage SpacedLinks SpacesInSimpleTables SpaceWikiWord SpaceWikiWords Spacing SpanInLink SpecialLinks SSWB Start StickyNotes StickyNotes1 Sting StmLink Stubs StyleClass StyleInLinkText Superscripts TableBackground TableBorders TableBug TableCellSpace TableDirectives TableTest Tabs Tags Template TemplateLinks Templating Terminology Test Test123 Test2 TestCache TestData TestDe TestDirectiveMarkup TestGroup TestLP Testm TestStyles TestToC TestÄöü Text TextArea TextareaFontTest TextTransform TextVars ThickBox Title TitleLinkWithQuery Titlespaced2004-05-08 TitleTest Tjolahoppsan TmpFeed TmplDisplay TOC1 Tooltips Top10NotRecentlyModified Topic1 TopNav Trail3 TrailFromPagelist TrailIndex TrailPage1 TrailPage2 TrailPage3 TrailPage4 TrailPath Umlauts UmlautUploads UploadForm Uploading UploadSimpleForm UploadsQuickReference URL UrlApprovals UrlError UrlParens UrlsWithDates UrlWithQuotes UserAndLevel UseTable UsingTabForPreformattedText VariablesAndFriends VerticalSpace VerticalSpacing1 VeryLongLinkText VoteOnFirstLastMarkup VoteOnLeadingWhitespace VoteOnLeadingWhitespace-Talk VoteOnNestedDivMarkup VoteOnNestedDivMarkup-Talk VoteOnSiteHeader VoteOnSiteHeader-Talk Voting Weird Whitespace WhitespaceRules WidthAttr WikiDefines WikiStyle WikiStyleClass WikiStyleDefines WikiStyleInCamelCase WikiStylePercent WikiStyleRED WikiStyleRight WikiStyles WikiStyleToTheEnd Wikitest WikiTrail WikiTrail1 WikiTrail2 WikiTrail3 WikiTrail4 WikiTrail5 WikiTrailPagelist WikiTrails WikiTrailsDraft WikiWord WikiWord2 WikiWord3 WikiWordCount WikiWordsAndStyles WildcardLinkSyntax Wildcards WildcardSlash WindowsFileUrls Withattrib2 WithHtml WordLinks WordWrap Wrap WSExtra WSIndent WSIndent2 WSIndent3 WSPlusCode XLPageUpdate XMLTest XMLTest2 XYTrail XYTrail1 XYTrail2 XYTrail3 XYTrail4 XYTrail5 XYTrail6 ZAPMcode
In the examples above, setting the name to n ("name=n") will make the form navigate to the page identified in the selected value of the input on submission. If you don't want to navigate to the page, try changing the name to something else.
Notes
Note that as of pmwiki-2.2.0-beta26, to have two select boxes inline, not only should you give them different name= parameters, but also have a separator, like a character, or even the null sequence [==] between them:
(:input form:)
(:input select name=FIRST value=1:)(:input select name=FIRST value=2:)[==]
(:input select name=SECOND value=3:)(:input select name=SECOND value=4:)
(:input end:)
Comments
Is it possible to fill the dropdown list with the content of a page (where I have written all the options line by line)? A kind of (:include:) but inside the dropdownlist. Such a feature should be nice for long lists! PhilB ? January 29, 2007, at 01:48 AM
What change would be needed in the php script in order to correctly process the "multiple" option in the test1 test2 ? Currently they are listed (thru GET method) as individual name=value1?name=value2 etc and so when the php script processes them it assigns whichever is the last one as the actual value. Thus instead of n values you end up with exactly 1 value, always the last one. The net effect is that form values are not maintained through the submission process. I can figure out how to process it otherwise in php, but I don't know what sort of data structure is being used for that "multiple" option -- is it an array? --Peter Bowers October 28, 2007
See Also
New Input Form markup demonstration (PmWiki 2.2.0 beta17)
Compatible recipes:
Cookbook:Pm Form Form processing engine for PmWiki
Cookbook:Fox Form processor to add, replace, copy, delete content plus upload files and send email notifications using templates and Input markup
Cookbook:Wiki Forms Use a form template to create, edit and list wiki pages
Cookbook:ProcessForm Maintain values in fields and make PVs of the form name/values when a form is submitted
Sandbox
Feel free to use the space below to experiment with creating forms.
(:input form vtest :)
(:input select name=test value=1 label=test1:)
(:input select name=test value=2 label=test2:) \\\
(:input text name=comment value="test12":)
(:input submit:)
(:input end:)
(:input textarea "Can a textarea's default value have a line \\
break in it?":)
Guess not! That's too bad!