Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Reset values

Posted on 2014-04-01
Medium Priority
Last Modified: 2014-06-01
I have lookup columns in the newform in SharePoint 2010.  I have a reset button on the form, which refreshes the fields using Form action.  All the other fields value is cleared on the form  except for the lookup columns. how to clear the lookup values on the newform? Please help.
Question by:ven1234
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

Sar1973 earned 2000 total points
ID: 39974402
Try this script:
function resettaform() {
	var myControlI = document.getElementsByTagName("input");
	var myControlS = document.getElementsByTagName("select");
	var myControlT = document.getElementsByTagName("textarea");
	for (var i=0; i<myControlI.length; i++) {
		if (myControlI[i].getAttribute("type") == "checkbox" ||
		myControlI[i].getAttribute("type") == "radio") {
			if (myControlI[i].getAttribute("name") == "Assistenza_scelta") {
			} else {
		} else {
	for (var j=0; j<myControlS.length; j++) {
		myControlS[j].options[0].selected = true;
	for (var k=0; k<myControlT.length; k++) {
		myControlT[k].value= "";


Open in new window


Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

722 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