I need to reset all the values of elements in my form to empty string. But the problem is that the form can be reset but the variable still holding the value of y previous input.

For exp,
Input 5 value at first time.
Input 2 value at second time. The rest of the 3 field will take the input value I input previously.

Here my reset function:

function resetForm(formId)
	var form, elements, elm;
		form = document.getElementById(formId)
		form = document.forms[formId];

	elements = form.elements
	* Clear default text of text elements
	for( i=0, elm; elm=elements[i++]; )
		if (elm.type == "text")
			elm.value ='';

Help! :'(

How is this ASP related?

I found a solution already. Thanks anyway... :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.