Click to See Complete Forum and Search --> : Clearing text boxes


guyute618
February 24th, 2003, 02:08 AM
I was trying to figure out how to clear out the information someone has filled into a series of textboxs after they click the submit button.

another words, they data the entered has been put in a database and I don't want the person to have the option of clicking submit again.

thanks

guyute

flappie
March 1st, 2003, 11:42 PM
What might be a simplistic manner and their would possibly be a better manner of doing this, but I would just set the text box being equal to nothing within the code of the submit button.

If submit button code has executed correctly,
textbox.text = ""
else
do so form of an error message.
end if

This has worked fine for me, it is just that it is extremely tedious if you have many text boxes.

guyute618
March 2nd, 2003, 02:52 AM
thank you for replying, but i still don't quite understand. how do i code "If submit button code has executed correctly"

is there a way to see if the database has been contacted, or if they textbox's have been loaded into variables? possible some type of boolean?

or maybe i'm just missing something, need to stop drinking so much.

thanks for answering.

guyute

Sonu Kapoor
March 2nd, 2003, 02:32 PM
You can do something like this:

// user pressed the submit button
if(submit.count>0)
{
// check whether user has entered something in the textfield
if(textfield.Text=="") // textfield is empty
do something....
else
do something else... // textfield is not empty
}

Hope this helps, Sonu