|
Introduction to Microcontroller Programming * Course Index * Introduction * About the Author * About this Course * Feedback * Course Navigation * Quick Course Navigation * How to use this Course * Acronyms Used and Course Conventions About PICmicro Chips * What is a PICmicro? * Microcontrollers * Digital versus Analogue * Inputs and Outputs * Memory * Programming * 16F1937 Architecture Clocking Your PICmicro Devices * Introduction * The Clock Circuit * Clock Settings * Clock Confusion E-Blocks * Introduction to E-blocks * Using E-blocks * E-blocks Boards Flowcode Step By Step * Introduction to Flowcode * Basic Flowcode Functions * Digital Outputs * Digital Inputs * Basic Loops * The LCD Display * Binary Numbers * Decisions * Goto (Connection Point) * 7-Segment Displays * Software Macro * Strings and Memory * A Simple Hi-Fi PICmicro Projects * Introduction to PICmicro Projects * Construction Methods * Choosing a Power Source * Adding Inputs * Input Conditioning * Adding Outputs * Adding Drivers Labs * Introduction and Lesson Plan * 1. Output * 2. Delay * 3. Connection Point * 4. Calculations * 5. Loop * 6. Input * 7. Decision * 8. LCD * 9. Keypad * 10. Analogue + EEPROM * 11. Software Macro * 12. External Interrupt * 13. Timer Interrupt |
(:Summary:Contains the 'action' links (like Browse, Edit, History, etc.), placed at the top of the page, see site page actions:) (:comment This page can be somewhat complex to figure out the first time you see it. Its contents are documented at PmWiki.SitePageActions if you need help. :) * Print (:comment (:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:) * %item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'% [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]] (:ifend:) :) * Login PmWiki /
Forms(:Summary: PmWiki group header. Includes styles and trail.:) (:comment please leave the multiple style definitions concatenated as a single line. Linebreaks do appear in the output when the wiki is configured with linebreaks enabled -- thanks!:) (:comment included in PmWiki localisation headers and footers :) This page explains how you can embed input forms into wiki pages. Input forms don't actually handle processing of the form data -- the feature simply allows creation of forms inside wiki pages. Forms processing can be found in the Cookbook (see below). MarkupTwo directives are used to begin and end forms: (:input form "''url''" ''method'':)
...
(:input end:)
The If your site uses ?n=Group.Page to specify the pagename then having a field The Note that this feature doesn't ensure that the form output is correct HTML -- it assumes the author knows a little bit of what he or she is doing. Notably, (:input form:) and (:input end:) shouldn't appear inside tables, and all form fields and controls should be inside an (:input form:)...(:input end:) block. Standard input controlsThe standard input controls are: (:input text ''name'' ''value'' size=''n'':)
(:input hidden ''name'' ''value'':)
(:input password ''name'' ''value'':)
(:input search ''name'' ''value'':)
(:input number ''name'' ''value'' min=x max=y step=z:)
(:input email ''name'' ''value'':)
(:input tel ''name'' ''value'':)
(:input url ''name'' ''value'':)
(:input date ''name'' ''value'':)
(:input radio ''name'' ''value'' ''label'' checked=checked:)
(:input checkbox ''name'' ''value'' ''label'' checked=checked:)
(:input select ''name'' ''value'' ''label'':)
(:input datalist ''id'' ''value'':)
(:input default ''default-name'' ''default-value'':)
(:input textarea ''name'' ''Where ''name'' and ''value'' are in the HTML syntax: name="addr" value="808 W Franklin". For most controls the markup has the form: (:input ''type'' ''name'' ''value'' ''parameter=value'':) where ''type'' is the type of input element (described below), ''name'' is the name of the control, ''value'' is its initial value, and parameters are used to specify additional attributes to the control. If ''value'' contains spaces, enclose it in quotes; if it contains newlines (for textarea and hidden elements), enclose it in 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
For the @@textarea@@ control a value can be set from PmWiki 2.2.0beta45 onwards. Enclose the value in The (:input submit value=''label'':) Here's a more complete example, e.g., for a login prompt:
General form field attributes* * The following advanced HTML attributes are supported: @@name, value, id, class, rows, cols, size, maxlength, action, method, accesskey, tabindex, multiple, checked, disabled, readonly, enctype, src, alt, title, required, placeholder, autocomplete, min, max, step, pattern, list, formnovalidate@@. For a more detailed description, see their counterparts in the w3c reference: HTML5 form attributes (not all of them can be used for all types of form fields). * For checkboxes and radio inputs, the "label" attribute text will be displayed ''after'' the input as a <label> element. Clicking on it will check or uncheck the input. The label can only be plain text (no inline formatting like bold or links). * In addition to these, the following attributes can be used for accessibility enhancements: @@role, aria-label, aria-labelledby, aria-describedby, aria-expanded, aria-pressed, aria-current, aria-hidden@@. * In addition to the default attributes, you can use custom data attributes like @@data-some-variable=value@@ or @@data-other="Some data"@@ (usable by custom JavaScript, CSS or by some libraries). The attribute must start with "data-" and only contain lowercase Latin letters [a-z] and dashes [-]. * Any unsupported attributes in the wiki markup will not be included in the HTML output.
|
(: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:) |
The values can be specified positionally:
(:input select abc 1 alpha :)
We can specify the size of the selection box:
(:input select abc 1 alpha size=3 :)
You can specify a multiple select box (only the first item needs to have "size=3 multiple" attributes):
(:input select abc 1 alpha size=3 multiple:)
To have an element selected, use @@selected=selected@@:
(:input select abc 2 beta selected=selected:)
Note that to have two select boxes inline, not only should you give them different @@name=@@ parameters, but also place 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:) |
Note, in the HTML output, only the attributes @@label@@, @@value@@ and @@selected@@ are applied to the <option> HTML tag. Any other attributes, including @@name@@, @@id@@, @@class@@ and @@title@@ are applied to the wrapping <select> HTML tag, and later definitions replace previous ones.
(:input datalist ... :)This allows a number of values (suggestions) to appear in a drop-down menu allowing the user to select one of the values or to fill a new, different value. The markup accepts named or positional attributes:
(:input datalist ''id'' ''value'':)(:input datalist id=''id'' value=''value'':)
An existing (:input text:) field needs to have an attribute @@list=id_of_the_datalist@@ to attach the suggestions.
The datalist element is invisible and can be anywhere in the page. The suggestion menu appears when the user starts typing in the attached text field and filters the suggested values that contain the letters typed in the text field.
Type a browser name: (:input text browsers list=dlist_id :) (:input datalist dlist_id Firefox:) (:input datalist dlist_id Chrome:) (:input datalist dlist_id Safari:) (:input datalist dlist_id Edge:) (:input datalist dlist_id MSIE:) (:input datalist dlist_id Opera:) (:input datalist dlist_id Lynx:) |
Type a browser name: |
This is a recent addition to the HTML standard, see https://caniuse.com/#feat=datalist for current browser support.
Note that if you have a datalist element immediately following another datalist element, not only should you give them different @@id=@@ attributes, but also place a separator, like a character, or the null sequence [==] between them:
(:input datalist dl_1 First:) (:input datalist dl_1 Second:)[==] (:input datalist dl_2 First:) (:input datalist dl_2 Second:)
*Cookbook:Input Default
*Cookbook:Form Validation
*Cookbook:Form Extensions
*Cookbook:Input Forms and JavaScript
*PageLists#searchbox The (:searchbox:) directive creates a form to search the wiki
Compatible recipes: * Cookbook:PmForm * Cookbook:Fox * Cookbook:Wiki Forms * Cookbook:ProcessForm
(:nl:)(:Summary:Trail and talk page links:) (:comment included in PmWiki localisation headers and footers :)
<<? >>bgcolor=#ffe border-top="1px solid black" font-size=.8em<< This page may have a more recent version on pmwiki.org: PmWiki:Forms, and a talk page: PmWiki:Forms-Talk. >><<
(:Summary: Website page footer:)
Print - (:comment (:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:) %item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'% [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]] (:ifend:) :) Search - Login
Page last modified on November 22, 2019, at 01:48 PM