Forums

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

Javascript to set default value on popups doesn't work

Marcela Junyent
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.
October 21, 2019

I want to apply a javascript to set a default current year value. I use the following script:

<script type="text/javascript">
CurrentYear= document.getElementById('customfield_10420');
CurrentYear.readOnly = true;
var year = new Date();
CurrentYear.value = year.getFullYear();
</script>

it works when the create window is not as popup.But if the screen is opened as popup, the script is not executed.

someone knows haoy to fix this? Thanks

 

 

0 answers

Suggest an answer

Log in or Sign up to answer