Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Reset values

Posted on 2014-04-01
3
Medium Priority
?
201 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
3 Comments
 
LVL 9

Accepted Solution

by:
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") {
				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

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

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
Suggested Courses

963 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