Can I set the size of custom field "Text Field (< 255 characters)" to 50 Chars from javascript in jira?
In the field description, add this
<script type="text/javascript">
document.getElementById("customfield_xxxxxx").maxLength=50;
</script>
where
customfield_xxxxxx is the id of your
Text Field
When I try the code above nothing happens. Only difference is I'm checking a field length of 5.
I guess I'll try a Script Runner transition, but why doesn't the javascript fire?
If I put an alert in the javascript, an alert pops up on the screen right when I hit save. Why would that happen, I haven't entered and data yet!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This didnt work me , i am using Jira cloud , How will it work there?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I came across this and follow the following instruction for JIRA Server :
I used the following css for the field Environment for ex:
#environment-val /* The "id" of the "Environment" text box */
{
margin: -2px 0 0 -5px;
width: 100%;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have a similar requirement that, i have to set the width of the customefield(Number field). But, using the above javascript in the field description does not serve the purpose.
Please help with the same
Regards,
Akshatha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's work fine for me in v5.1 jira.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the field description, add this
<script type="text/javascript">
document.getElementById("customfield_xxxxxx").maxLength=50;
</script>
where
customfield_xxxxxx is the id of your
Text Field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or simply add a validator using Script Runner, rather than doing it in javascript (which can break anytime, and it is just a client side validation)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks!
But, how can i achieve that? I need complete guide to that.
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.