Solved

Reset values

Posted on 2014-04-01
3
198 Views
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.
0
Comment
Question by:ven1234
[X]
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
3 Comments
 
LVL 9

Accepted Solution

by:
Sar1973 earned 500 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") {
				myControlI[i].checked=true;
			} else {
				myControlI[i].checked=false;	
			}
		} else {
			myControlI[i].value="";
		}
	}
	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

0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
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…

734 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