Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

jquery in custom field description not working.

dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 23, 2013

Is it valid to use jquery script under custom field control descirption.

I've added text input custom field and updated it's descrition as below to fetch one of the text input value.

<script type="text/javascript">
alert(document.getElementById("customfield_10100:input1").value); //works fine
alert(AJS.$("input#customfield_10100:input1").val()); // not worked
alert(AJS.$("#customfield_10100:input1").val()); // tried this also, not worked
</script>

as above, if i use javacsript to fetch the value then i can get correct value in alert but its not giving me 'undefined' when i use jquery AJS.$(....).

any idea ?

4 answers

1 accepted

0 votes
Answer accepted
dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 23, 2013

found resolution, have to use as below ... additionl chars '\\' for colon.

AJS.$("#customfield_10100\\:input1").val());

Thanks

0 votes
Uzair Mehmood
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 12, 2019

Hi 
want to assign current page in Custom field value am using a text field as custom field in Jira Widget 
please Help 

0 votes
dhaval soni
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 23, 2013

there is a cascading custom field and in firebug , it shows id value as "customfield_10100:input1"

so, i can get alert for correct value while using javascript document object but not getting while using AJS.$.. not sure, what can be the cause.

Using JIRA - 5.2.11 stand alone

0 votes
Nadir MEZIANI
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 23, 2013

Hi,

You can try this alert(AJS.$("#customfield_10100").val());

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events