Reset Button

Hello,

I’m initing a form with XML. The XML includes 3 fields and 2 buttons.
The save button works fine. But the reset one doesnt.

The HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-br" lang="pt-br">
	<head>
		<title>Teste</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link rel="stylesheet" type="text/css" href="js/css/skins/dhtmlxform_dhx_skyblue.css">
		<script src="js/dhtmlxcommon.js"></script>
		<script src="js/dhtmlxform.js"></script>
		<script src="js/dhtmlxdataprocessor.js"></script>
		<script src="js/connector/connector.js"></script>			
	</head>

	<body>
		<div id="cont" style="height:350px;">
			<div id="myForm1"></form>
			
			<script>
				var myForm = new dhtmlXForm("myForm1");
				myForm.loadStruct("form.xml");
				
				var dp = new dataProcessor("servlet/contato");
				dp.init(myForm);				
			</script>
		</div>	
	</body>
</html>

The XML Form:

<items>
   <item type="input" name="id" value="" label="Id"/>
   <item type="input" name="name" value="" label="Your Name"/>
   <item type="input" name="age" value="" label="Your Age"/>
   <item type="button" name="btReset" value="Reset" command="reset"/>
   <item type="button" name="btSave" value="Save" command="save"/>
</items>

I already try a customCommnad with “myForm.reset();”, but it doesnt works. The documentation have some RESET buttons, but anyone works.

Thanks.

Luís Fernando Murara
Brazil

I tried command “remove”, and change the target from DIV to FORM tag, but it doesnt work.
During the tests, the save button works fine.

I make a workaround to reset button. It works, but I need to fell line codes:

myForm.attachEvent("onButtonClick", function(name){
					if (name == "btReset") {
						document.myForm1.reset();
					}
					return true;
				});

Thanks.