In your asp.net application there is a textbox, How can clear the textbox with out round trip?

Showing Answers 1 - 2 of 2 Answers

Chakravarthi

  • Oct 5th, 2006
 

by using javascript function we can clear the textbox value like

textbox1.value=null; or textbox1.value="";

  Was this answer useful?  Yes

Chairkalai

  • Nov 11th, 2006
 

Assume that your textbox ID is TextBox1. And the button ID is Button1. If you want to clear the text from textbox by clicking the button without refresh then do the following steps.

1) In Page_Load  write

Button1.Attributes.Add("OnClick","clearIt();");

2) In javascript write the function

function clearIt()

{

document.getElementById('TextBox1').value = "";

}

Just do it.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions