how to add placeholder to inline input field?
how to add placeholder to inline input field?
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
The
text
type has anattr
option which allows you to specify attributes for the node. The second example on thetext
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