How can I add a line break into the placeholder text area of the RSform?
Tried without success:
- \n - <br/> -
A sample of the form with the non working text area can be found here at the last page as guarantees field: freelancer-form
Joomla Stack Exchange is a question and answer site for Joomla! administrators, users, developers and designers. It only takes a minute to sign up.Sign up to join this community
Many people offer js and non-js solutions here: https://stackoverflow.com/q/7312623/2943403
Using a non-js technique may have different outcomes on different browsers -- specifically standards compliant versus non-compliant browsers. The reason for this obstacle:
The placeholder attribute represents a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format. The attribute, if specified, must have a value that contains no U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR) characters.
My cleanest recommendation is not to fight the placeholder attribute and just express the
e.g. as plain text outside of the textarea tag or be content with asingle wrapping line of text. This will likely provide an improved UX for visually impaired visitors.
p.s. I'll ask @sirobertson to advise about how we got our JoomlaDayAustralia2019 survey to correctly position the page after clicking Next.
You can always use a CSS/jQuery workaround, and make the placeholder a div element with absolute positioning under the text area, and have the text area use a transparent background.
Then you change the textarea background to a solid color on focus, and use jQuery to detect if the textarea has any content. It must add a CSS class to the textarea if it is not empty, and remove that class if it's empty. The class will just define a solid color background.