...

View Full Version : reset form



coolumanga
11-19-2010, 07:59 AM
<script type="text/javascript">


function resetForm()
{
//noofrow = document.getElementById("NoOfRow").value;
//form = document.getElementByID('form1');
//noofrow.reset();
d1=document.getElementById("textfield").value;
d1="";
d1.reset();
return false;
}



</script>

</head>

<body>
<form id="form1" name="form1" method="post" action="">
<p>
<label>
<input type="text" name="textfield" id="textfield" />
</label>
</p>
<p>
<label>
<input type="text" name="textfield2" id="textfield2" />
</label>
</p>
<p>
<label>
<input type="text" name="textfield3" id="textfield3" />
</label>
</p>
<p>
<label>
<input type="Submit" name="button" id="button" value="Submit" onclick="resetForm()" />
</label>
</p>
<p>&nbsp;</p>
</form>

how do i reset first input box ..............other data should be remain as follows................


plz help me to do this

abduraooft
11-19-2010, 09:05 AM
<input type="Submit" name="button" id="button" value="Reset" onclick="document.getElementById('textfield').value='';" />

coolumanga
11-19-2010, 09:29 AM
[QUOTE=abduraooft;1017513]
<input type="Submit" name="button" id="button" value="Reset" onclick="document.getElementById('textfield').value='';" />[/QUOTE

thankz for the reply still resetting all the fields .

still not solved the problem

plz help me to do this.

poyzn
11-19-2010, 10:21 AM
<input type="button" value="Reset" onclick="document.getElementById('textfield').value='';" />



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum