ok, first off this works in FF, Chrome and Safari, but does not work in IE.

  • What I am doing is converting the complex dropdown to a simple dropdown using SPServices
  • Auto-populating the projects column with a querystring parameter

Here is the code:

        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.1a/jquery.SPServices-0.7.1a.min.js"></script>                   
    <script type="text/javascript">


            columnName: "Project"

        function getQuerystring(key, default_)
          if (default_== null) default_=""; 
          key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
          var regex = new RegExp("[\\?&amp;]"+key+"=([^&amp;#]*)");
          var qs = regex.exec(unescape(window.parent.location.href));
          if(qs == null)
            return default_;
            return qs[1];

        var proj = getQuerystring('proj');

        //var list = document.getElementById('ctl00_m_g_dd8909e5_25f4_49a8_b1d6_229952d5ab91_ff101_ctl00_Lookup');
        $('#ctl00_m_g_dd8909e5_25f4_49a8_b1d6_229952d5ab91_ff101_ctl00_Lookup option:contains(' + proj + ')').attr('selected', 'selected');

            //var list = document.getElementById('SPComplexToSimpleDropdown_Project');

            $('#SPComplexToSimpleDropdown_Project option:contains(' + proj + ')').attr('selected', 'selected');
            var selectedVal = $('#SPComplexToSimpleDropdown_Project option:contains(' + proj + ')').val();

            //set the complex dropdowns value 
        }//end if


Again, it works great, accept in IE. I know that the problem lies within assigning the value to the sharepoint complex dropdown. but now sure how to set that.


First off, you can use $().SPServices.SPGetQueryString rather than rolling your own Query String parser. Secondly, you should be able to just set the simple select and not worry about the hidden complex select. The $().SPServices.SPComplexToSimpleDropdown function takes care of updating the complex select under the covers. Finally, you shouldn't need any different logic for IE than the other browsers.

  • would it be actually that being hidden in IE particularly is doesn't return value? – Marius Constantinescu - MVP Apr 23 '12 at 20:21
  • It's possible that you will have to fire the change event on the simple select manually after setting it. It certainly can't hurt. – Marc D Anderson Apr 23 '12 at 20:35
  • is there any documentation on the change event? how can I fire? – Brenton Pierce Apr 23 '12 at 20:37
  • Have a look here api.jquery.com/trigger – Marius Constantinescu - MVP Apr 23 '12 at 20:50
  • <select> <option value="0">One</option> <option value="1">Two</option> </select> $('select').val('1'); // selects "Two" $('select').val('Two'); // also selects "Two" Try to set the value to something fixed to make sure that the selected item is set, prior to setting it dynamically! – Marius Constantinescu - MVP Apr 23 '12 at 21:18

Try setting the Selected using


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.