Click here to Skip to main content
16,004,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I have a requirement to build a set of 5 links within the SharePoint intranet of the client. Users within the site can select of these 5 links which ones they want to see on their home page and add it. The selection should be an easy checkbox selection which gives users the flexibility to add/remove links they want to see on the homepage.

I did some finding and seems jquery could be a win in this. But not sure how to proceed as I haven't worked on jquery before. If someone can point me to right direction, it will be helpful.

Thanks in advance.
Posted

Hi,
first,you'd better push the checkbox id(or SharePoint) into an array;
then use ajax pass the array value to(php,aspx side)->Mysql
last read Mysql,the users will see the SharePoint on the homepage.
JavaScript
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
	$(function(){
		$("#abv").click(function(){
			var ar=new Array();
			$("input:checkbox:checked").each(function(){
				alert("you choose:"+$(this).parents('span').text());
				ar.push($(this).attr('id'));
			});
			alert(ar);
			/*$.getJSON{'a.php',{id,ar},function(result){//AJAX 
			});*/
		});
	})
</script>
<div id="div1">
<input type="button" id="abv" value="test"/>
</div>
<span><input type="checkbox" id="1">http://www.codeproject.com/Questions/1</span>
<span><input type="checkbox" id="2">http://www.codeproject.com/Questions/2</span>
<span><input type="checkbox" id="3">http://www.codeproject.com/Questions/3</span>
<span><input type="checkbox" id="4">http://www.codeproject.com/Questions/4</span>
<span><input type="checkbox" id="5">http://www.codeproject.com/Questions/5</span>
 
Share this answer
 
Comments
AnandSharmaUK 23-Apr-13 6:40am    
Nice solution btw. Thanks
I cannot use MS-SQL in my case. Anyways, I found the solution myself. Thanks for your help.

I create a list of the links and populate the user's name in the item which they want to see. Filter that using custom webpart in visual studio on page load.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900