0

How can I add a line break into the placeholder text area of the RSform?

Tried without success:

- \n
- <br/>
- &#10;

A sample of the form with the non working text area can be found here at the last page as guarantees field: freelancer-form

0

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.

  • do not get your point about JoomlaDay? – cilap Dec 31 '18 at 11:21
  • When I click Next on your form, the loaded page position is awkward. My fellow event coordinator fixed this issue, but I don't know what he did. – mickmackusa Dec 31 '18 at 12:37
  • ahh okay getting it. I have created a new issue for the new topic joomla.stackexchange.com/questions/23987/… and many thanks for pointing to the new issue! – cilap Jan 1 at 19:35
0

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.

  • do you have specific example for rsforms? – cilap Feb 9 at 8:44

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.