how to setfocus back to text box after clciking reset button

hi everyone

my problem is:

i have an text box .after entring the value in this user press calculate button .

then there is reset button .where he can reset the value.\

the problem i am getting is after clicking reset button cursor focus is not going back to textbox

how to do that

pleasehelp code is below

funtion clear()

{

document.form1.T2.value="";

document.getElementById("quant").focus();

}

<input type="text" name="T2" size="12" id="quant">

<input type="reset" value="Reset" name="B4" onclick="return clear();">

[613 byte] By [saswat1579a] at [2007-11-27 11:46:38]
# 1

hi,

<input name="reset" type="reset" onClick="document.newcustForm.name.focus()"/>

newcustForm is your form name

drvijayy2k2a at 2007-7-29 18:08:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

You're not returning false in the onclick, so the form will be submitted anyhow, therefore causing the focus being lost.

Add return false; to the function, or replace onclick="return clear();" by onclick="clear(); return false;" so that the form will not be submitted.

BalusCa at 2007-7-29 18:08:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...