How to get value from Lookup Field on onchange event? RRS feed

  • Question

  • Hi,

    below is the code to get value from lookup field in listform in sharepoint 2010.


    var ctrl= $("input[title='Deliverable Type']");  var oldset = _SetCtrlFromOpt; _SetCtrlFromOpt = function(ctrl, opt){ alert("changed!"); oldset(ctrl, opt);

    var sText= opt.options[opt.selectedIndex].text;

    // call the below function with the value passed.

    initialize(stext); }},"core.js");

    below line is to get lookup field in list form

    var ctrl= $("input[title='Deliverable Type']"); 

    in above line title is Title of Lookup Field.

    below is the line to get selected text

    sText= opt.options[opt.selectedIndex].text;



    Monday, February 24, 2014 7:16 PM


  • Hi,

    According to your post, my understanding is that you want to get value from lookup field on onchange event.

    We can use jQuery to achieve it, the following code for your reference:

    <script src="" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("select[title='Deliverable Type']").change(function () {
                var value = $(this).find("option:selected").text();

    Best Regards

    Dennis Guo
    TechNet Community Support

    Tuesday, February 25, 2014 5:13 AM