Please post the sample code for better understandings. I am pretty new to plugin development and jira.
Depends - are you using an existing field? Are you writing your own field? Do you want to do it in html, or just validate the length after the user posts something? Or drop the extra characters?
As an aside, you probably won't get sample code here. We prefer you to understand what you're doing than parrot code that someone else has made the effort to learn/write etc.
I am using an existing field that is out of the box. I want to restrict to 100 characters only to a specific project . I want to do it in a simple way so that it is easy to apply in different environments. This needs to be done before posting . I have tried javascript but it didn't work. This what I tried in Javascript
<script type="text/javascript">
customLimitField = document.getElementById("customFieldId_10900");
customLimitField.onKeypress = limitText;
function limitText(){
customLimitField = document.getElementById("customFieldId_10900");
if(customLimitField.text.length >= 50)
{
customLimitField.value = customLimitField.value.substring(0,50);
}
}
</script>
Please help me to understand this and fix it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Javascript is not a perfect solution. I wrote my own custom field and restricted to 100 characters using the API and sample code from google.
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.