NUBIC / surveyor

A Rails gem that lets you code surveys, questionnaires, quizzes, etc... and add them to your app.
http://nubic.github.com/surveyor
MIT License
751 stars 274 forks source link

Input placeholder text #395

Open markedmondson opened 11 years ago

markedmondson commented 11 years ago

Is there any reason why a textarea or string answer couldn't use the (currently unused) :help_text and set it as the placeholder text on the input?

I see it being particularly useful in the context of a question with radio options such as:

q "Why did you choose to stay with us this time?", :pick => :one a "Your company chose us for you" a "A friend or colleague recommended us" a "Your travel agent recommended us", :string, :help_text => "Agent name" a "You viewed information on the internet", :string, :help_text => "Website name"

I could probably create a pull request if there's consent.

yoon commented 11 years ago

I believe :help_text now works appropriately (#373), but you could certainly create a custom renderer to have it display as placeholder text. I think placeholder text could be valuable as a separate attribute.