Sharepoint HTML dropdown

Posted on 2012-08-15
Last Modified: 2012-08-22

What I want to do is...I want to build an HTML drop down on a webpart page (Preferably using HTML form webpart). The values of the dropdown should be a unique list of values derived from a sharePoint list field. when a user selects a value i want to pass the parameter to another webpart using webpart connections.

Out of the box HTML form webpart only shows a textbox where you can type the values..but I want a dropdown instead...please help..

Question by:Techsavy
    LVL 44

    Expert Comment

    by:Rainer Jeschor
    which SharePoint version and edition are you talking about?

    You can use the OOTB HTML Form web part. Add it to the page, then click "Modify web part" and then use the "Source Editor" to modify the HTML source.
    <div onkeydown="javascript:if (event.keyCode == 13) _SFSUBMIT_">
    <select name="SelectTool">
    	<option value="">Please select</option>
    	<option value="VS 2010">VS 2010</option>
    	<option value="WCF">Windows Communication Foundation</option>
    	<option value="SL">Silverlight</option>
    <input type="button" value="Go" onclick="javascript:_SFSUBMIT_"/></div>

    Open in new window

    Then connect the web part with your list view webpart. The values of the select must match the column values.


    Author Comment

    Hi Rainer,

    Thank you for your suggestion. However,  I need to populate HTML form webparts' dropdown with unique values from a SharePoint list's column. Can we use Javascript Client object model to retrieve unique values of a ShaarePoint list column? If so can you provide some sample script?

    LVL 44

    Accepted Solution

    as from your other question - yes you could use client side scripting as you are on SharePoint 2010.

    Alternative way to client model:
    SPServices - jQuery library for SharePoint web services


    Author Comment

    Hi Rainer,

    I tried using client object model but I was not able to pass the selected value from the HTML form we part drop down to the connected web part . It is always sending an empty string.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    A question that is asked often, is how to generate sequential numbers in InfoPath Forms. The best way to achieve this is to use a SQL database, along with a stored procedure and a web service to connect Forms Services to the DB. The first thing t…
    There is one common problem that all we SharePoint developers share: custom solution deployment. This topic can't be covered fully in this short article, so all I want to do in this one is to review it from a development-to-operations perspectiv…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now