I want to get default value when I select the checkbox and user defined value when I deselect it.
For example in my dialog I have a textfield and a checkbox so if I check it I want to get title from current page and if I uncheck I want user to be able to give some title.
Similar functionality I saw in Teaser component but the difference there is the title can be taken for any of the page with provided link I want to limit it to current page.
Can anyone help me with the js for the same?