Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > | Form Plugin ExamplesSee TWiki.FormPlugin Please view the raw text of this topic to learn how these forms are created.Form elementsMulti-select items<--FormPlugin form start--> <--/FormPlugin form end--> Disabled<--FormPlugin form start--> <--/FormPlugin form end--> Read-only<--FormPlugin form start--> <--/FormPlugin form end--> Password<--FormPlugin form start--> <--/FormPlugin form end--> Date<--FormPlugin form start--> <--/FormPlugin form end--> Getting form feedbackRetrieving values with URLPARAM<--FormPlugin form start--> <--/FormPlugin form end-->Submit form to view values:
Formatting formsHints and mandatory indicators<--FormPlugin form start--> <--/FormPlugin form end--> Format: example of items on one lineFor example setting paramelementformat=" $t $e $m $h " :
<--FormPlugin form start--> <--/FormPlugin form end--> Adding CSS stylesSetting:formcssclass="foswikiFormSteps" elementcssclass="foswikiFormStep" <--FormPlugin form start--> <--/FormPlugin form end--> Custom CSS classes<--FormPlugin form start--> <--/FormPlugin form end--> Javascript enhancementsFocusThis example is disabled by default, because new browsers automatically scroll the page to the input field with focus. Show Focus example Original source:%STARTFORM{ name="focusform" action="view" }% %FORMELEMENT{ name="Name" type="text" focus="on" title="Your name:" }% %ENDFORM% Default text before clickClick on the field...<--FormPlugin form start--> <--/FormPlugin form end--> onMouseOver, onMouseOutMouse over the field...<--FormPlugin form start--> <--/FormPlugin form end--> onSelect, onBlurDoubleclick on the text to select it...<--FormPlugin form start--> <--/FormPlugin form end--> onKeyUpChange the text... (in fact,onChange can be used as well, but that tends to react slower)
Change output will be written here...
<--FormPlugin form start--> <--/FormPlugin form end--> onClickClick a checkbox...<--FormPlugin form start--> <--/FormPlugin form end--> onSubmitGive a warning before submitting the form...<--FormPlugin form start--> <--/FormPlugin form end--> ValidationIf the form is filled in correctly you will be redirected to FormPluginExamplesFeedback.<--FormPlugin form start--> <--/FormPlugin form end--> Substitution of field referencesReference field values as variables. In hidden field 'CarbonCopy' we are creating a combined entry ofName and Password fields:
%FORMELEMENT{ name="CarbonCopy" type="hidden" default="$Name earns $Salary" }% <--FormPlugin form start--> <--/FormPlugin form end--> Real world examplesSave topic text to another topic<--FormPlugin form start--> <--/FormPlugin form end--> Upload<--FormPlugin form start--> <--/FormPlugin form end--> Working together with CommentPlugin to create HolidaylistPlugin entriesWe want to create a form to enter holiday data: a 'from' date and a 'until' date. The default date format from HolidaylistPlugin is:* from_date - until_date - wikiusernameWe want an easy entry form, but the data must not get corrupted. So:
<--FormPlugin form start--> <--/FormPlugin form end-->
Working together with CommentPlugin: filling a tableThis form uses TWiki.CommentPlugin to write submitted values to a table. A user-friendly display of table data is not included in the example.<--FormPlugin form start--> <--/FormPlugin form end--> Article data<-- /editTable --> <--InsertPoint--> SendEmailPlugin formE-mail form for SendEmailPlugin - form works if the plugin is installed and enabled. %SENDEMAIL%<--FormPlugin form start--> <--/FormPlugin form end--> Accessing other sites: FlickrThis form lets you search for Flickr photos that have been tagged with a name. Note: for this example to work, addhttp://www.flickr.com/ to {PermittedRedirectHostUrls} in configure.
<--FormPlugin form start--> <--/FormPlugin form end--> |