how to add placeholder to inline input field?

how to add placeholder to inline input field?

sagimannsagimann Posts: 18Questions: 9Answers: 0

hi all, I am using inline editor, I would like to do 2 things:
1. when the user starts inline edit, I want an input placeholder to appear like in <input placeholder="xxx"> for example: "enter URL here"
2. in my case, it is possible to leave a field empty. For empty fields, I also want a placeholder to appear (but it is not an input field when not being edited, it's a simple <td>

I am thinking the second part I can do with the "render" property (if empty, set to placeholder text in a gray color)
but I am not sure on the proper way to do the 1st thing...

any ideas?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    The text type has an attr option which allows you to specify attributes for the node. The second example on the text documentation page shows how it can be used to set a placeholder. The HTML placeholder attribute will do what you are looking for.

    Regards,
    Allan

This discussion has been closed.