Drop down box

Confluence User - 13 Apr, 2020

I want to fetch the select box/ Dropbox data into a text box. How can I do it? Below is the code please help me out with this


I tried doing this by form util, but I was not successful. 

<script language="JavaScript" type="text/javascript">
    function singleSelectChangeText() {
        //Getting Value
        
 
        var selObj = document.getElementById("singleSelectTextDDJS");
        var selValue = selObj.options[selObj.selectedIndex].text;
        
        //Setting Value
        // document.getElementById("textFieldTextJS").value = selValue;



        if (selValue=="OBC"){
            window.alert("HEY YUR RYT");
        }
        else 
        {
            window.alert("byeeee");
        }
    }
</script>


This JavaScript code is perfectly running on Visual Studio, Fetching the data of the select box and displaying it in the text box, but in joget am not able to implement the code, my code is not fetching the select box data. Can you please have me out with. As this is the only place where I am tucked will be thankful if you provide me a solution for this.

Thank You!

forms;selectbox;user

3


13 Apr, 2020
confluenceUser
confluenceUser
// I think it's much easier to use jquery. I use something like this in my codes

let $selector = FormUtil.getField('<field id>');
$selector.each(function() {
$(this).val('<field value>');
});


13 Apr, 2020
confluenceUser
confluenceUser

Ok ill try implementing this thank-you!

13 Apr, 2020
confluenceUser
confluenceUser

Hey, this didn't work for me tho. The select box is not read

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print