• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1870
  • Last Modified:

Sharepoint HTML dropdown

Hi,

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..

Thanks...
0
Techsavy
Asked:
Techsavy
  • 2
  • 2
1 Solution
 
Rainer JeschorCommented:
Hi,
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.
E.g.
<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>
</select>
<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.

HTH
Rainer
0
 
TechsavyAuthor Commented:
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?


Thanks,
0
 
Rainer JeschorCommented:
Hi,
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
http://spservices.codeplex.com/

HTH
Rainer
0
 
TechsavyAuthor Commented:
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.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now