I find EDITFORMFIELD really handy to use but am wondering if there was any way to include the HTML placeholder attribute? I've read the documentation on forms and EDITFORMFIELD however am not fully understanding the "attributes" comments and haven't had any luck finding an example.
For example:
<input type="text" name="TestField" size="30" class="twikiInputField twikiEditFormTextField" placeholder="This is placeholder text">
My guess at TWiki markup up (not working):
%EDITFORMFIELD{"TestField" topic="TestTopic" placeholder="This is placeholder text"}%
Reading the code, the EDITFORMFIELD should pick up any foo="bar" parameter. Test:
Written as:
%EDITFORMFIELD{ "form" type="start" }%
Server OS:
%EDITFORMFIELD{ "ServerOS" type="text" form="SupportForm" placeholder="This is placeholder text" }%
%EDITFORMFIELD{ "form" type="end" }%
The key is to specify a type="text" parameter.
-- Peter Thoeny - 2016-08-12
Thanks Peter. Is there a good place where I could add some examples to the documentation (I noticed you updated TWikiForms to include placeholder which I think is a really handy attribute)?
Also, is there something I'm missing trying to use placeholder in a textarea?
Example textarea:
I've tried:
%EDITFORMFIELD{ "form" type="start" }%
Text Area Field with Size: %EDITFORMFIELD{ "TestFieldArea" type="textarea" form="Sandbox.TestPlaceholderForm" size="100x5" placeholder="This is placeholder text" }%
Text Area Field with Rows and Cols: %EDITFORMFIELD{ "TestFieldArea" type="textarea" form="Sandbox.TestPlaceholderForm" rows="5" cols="100" placeholder="This is placeholder text" }%
%EDITFORMFIELD{ "form" type="end" }%
Output:
-- Jani Hamalainen - 2016-08-12
The type="" is designed for HTML input tags. A textarea is related, but not an input tag, hence not part of the current spec. Nevertheless since this is useful we can enhance EDITFORMFIELD to support type="textarea"; proposal at VarEDITFORMFIELDwithTextarea.
Patch:
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.