<-- back to the mailing list

Proposal: Simple structured form specification

easrng easrng at gmail.com

Tue Jan 26 23:16:30 GMT 2021

- - - - - - - - - - - - - - - - - - - 

I agree that Gemini should have forms, but that format doesn't lookgreat to me. What if forms were implemented as their own pages, not anew link line type? I'm thinking something like this:

Gemini Form Proposal## Basic FormatForm fields are on their own line. Any line starting with `[in` isconsidered a form element. This allows clients to continue todetermine line types by the first 3 characters. After the `[in`, adash is required.After the dash, the input type is listed. If a client cannot handle aninput type, it SHOULD fall back to text. The rest of the line, up tothe first ] is used as options for the input. Next, there is a ]character, then an optional text label.## Escape sequencesIn order to allow for ] characters, newlines, and literal backslashesin input options, preface them with a backslash.## Input typesOther types could be added, like number, email, phone, color, or evenfile, but I feel this is an acceptable minimum set of types.### textA text input is a single line text input. Its format is as follows.(Things in parentheses are optional)```[in-text <name>( <initial value>)]```For example,```[in-text userFullName Alex Fierro] What is your name?```### passwordA password input is a single line text input that MUST hide the valuetyped into it. For security reasons, there is now way to prefill apassword input. Its format is as follows.```[in-password <name>]```For example,```[in-password newPassword] What is your name?```### multilineA multiline input is a text input that accepts any number of lines.Its format is as follows. (Things in parentheses are optional)```[in-multiline <name> ( <initial value>)]```For example,```[in-multiline bio I am a demigod who enjoys art and the colors pinkand green.\nI usually use she/her pronouns, but sometimes I usehe/him.] Tell me about yourself```### submitA submit input is a button that submits a form to a URL. It's labelSHOULD be used as the text on the button. Its format is as follows.```[in-submit /url/to/submit/to]```For example,```[in-submit /cgi-bin/profile.py] Update Profile```## SubmittingWhen an `[in-submit]` is (clicked|tapped|activated with thekeyboard|etc) all named inputs on the page (submit buttons are notnamed) will be added to the URL of the submit button as queryparameters, and the resulting URL will be loaded.

- easrng