Hello,
I am wondering if there is a way to add an inline text for a custom field (single line or multi line) in JIRA? Once the user clicks inside the field or starts typing, the inline text should disappear. Note, I don't want that inline text to be considered as an existing value. What I mean is that if the user doesn't enter anything in that field and if I have a field required validation, I would like the validation to work regardless of that inline text. I am sorry if that is confusing.
I am guessing I have to add some script to the custom field description but I don't know how to write up the code. Please help!
Thanks,
Shahriar
Hello, Shahriar.
I believe you're talking about adding a placeholder in the field.
You can do this with a "Hideable Free Text Field (unlimited text)" field type.
Create the custom field with that type and then you can add the following into the description field:
<script type="text/javascript">
document.getElementsByName('customfield_10700')[0].placeholder='This will appear as a placeholder';
</script>
Keep in mind to add the code in the right description, go in the custom field page, click in the Cog icon on the right, then in Edit.
Also, to get the field's ID to put in the "getElementsByName" function, check the URL in the edit page itself:
http://localhost:8080/secure/admin/EditCustomField!default.jspa?id=10700
In this case, the element name should be "customfield_10700".
Kind regards,
Maurício Karas
Hi Maurício,
Thank you, Sir! You are a genius. It worked beautifully! Thank you so much for your help.
Thanks,
Shahriar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried this and while it did add a placeholder I found that when I went to the Custom Field page (the one with the list of custom fields on), this page with this field would not load. I suspect it is because the description is now read only and a javascript error is being generated.
Is this the case for everyone or have I missed something?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nigel Mahoney I have the same problem as mentioned and can no longer edit the field unless I type the URL to edit that custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is now the same for us. I work with Shahriar and we upgraded from 8.5.5 to 8.11.1 and now we lost the ability to make edits directly from the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.