[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

Clearing controls after posting to db

george atkins

12/26/2002 11:14:00 PM

What is the most effective way to clear a variety of text
boxes and dropdowns after posting their contents to a
database, but without closing the form?

I want to leave the form up for additional entries, but
I'd like to have the previous choises removed so that they
do not maintain the previous time entry. However, I'm not
talking about removing data sources, of course.

Thanks,
George Atkins
5 Answers

Victor Garcia Aprea [MVP]

12/27/2002 8:40:00 PM

0

Are you talking about clearing the field at the client-side or at the
server-side?

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.


"gkatkins" <nospam_mndipper@yahoo.com> wrote in message
news:027c01c2ad2c$36652600$d5f82ecf@TK2MSFTNGXA12...
> What is the most effective way to clear a variety of text
> boxes and dropdowns after posting their contents to a
> database, but without closing the form?
>
> I want to leave the form up for additional entries, but
> I'd like to have the previous choises removed so that they
> do not maintain the previous time entry. However, I'm not
> talking about removing data sources, of course.
>
> Thanks,
> George Atkins


george atkins

12/27/2002 9:54:00 PM

0

Good question. I suppose at the server side. There are
several dropdowns that are filled from database tables,
along with text boxes. Once the user chooses values from
the dropdowns, enters the textboxes and clicks the Submit
button, I want the fields to clear the user choices to
allow a new time entry. So, would that be server side?

George

>-----Original Message-----
>Are you talking about clearing the field at the client-
side or at the
>server-side?
>
>--
>Victor Garcia Aprea
>Microsoft MVP | ASP.NET
>To contact me remove 'NOSPAM'. Please post all questions
to the newsgroup
>and not by private mail.
>
>
>"gkatkins" <nospam_mndipper@yahoo.com> wrote in message
>news:027c01c2ad2c$36652600$d5f82ecf@TK2MSFTNGXA12...
>> What is the most effective way to clear a variety of
text
>> boxes and dropdowns after posting their contents to a
>> database, but without closing the form?
>>
>> I want to leave the form up for additional entries, but
>> I'd like to have the previous choises removed so that
they
>> do not maintain the previous time entry. However, I'm
not
>> talking about removing data sources, of course.
>>
>> Thanks,
>> George Atkins
>
>
>.
>

Victor Garcia Aprea [MVP]

12/29/2002 11:03:00 AM

0

Yep, its sounds like server side. So you may want to try something like
this:
[C#]
// get a reference to your form control
Control frm = FindControl("YourFormID");
foreach(Control ctrl in frm.Controls)
{
TextBox tb = ctrl as TextBox;
if(ctrl!=null)
tb.Text="";
}

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.


"gkatkins" <nospam_mndipper@yahoo.com> wrote in message
news:020f01c2adea$32aa0170$d4f82ecf@TK2MSFTNGXA11...
> Good question. I suppose at the server side. There are
> several dropdowns that are filled from database tables,
> along with text boxes. Once the user chooses values from
> the dropdowns, enters the textboxes and clicks the Submit
> button, I want the fields to clear the user choices to
> allow a new time entry. So, would that be server side?
>
> George
>
> >-----Original Message-----
> >Are you talking about clearing the field at the client-
> side or at the
> >server-side?
> >
> >--
> >Victor Garcia Aprea
> >Microsoft MVP | ASP.NET
> >To contact me remove 'NOSPAM'. Please post all questions
> to the newsgroup
> >and not by private mail.
> >
> >
> >"gkatkins" <nospam_mndipper@yahoo.com> wrote in message
> >news:027c01c2ad2c$36652600$d5f82ecf@TK2MSFTNGXA12...
> >> What is the most effective way to clear a variety of
> text
> >> boxes and dropdowns after posting their contents to a
> >> database, but without closing the form?
> >>
> >> I want to leave the form up for additional entries, but
> >> I'd like to have the previous choises removed so that
> they
> >> do not maintain the previous time entry. However, I'm
> not
> >> talking about removing data sources, of course.
> >>
> >> Thanks,
> >> George Atkins
> >
> >
> >.
> >


Jonathan Berry

12/30/2002 8:17:00 PM

0

My problem is a little different but I think this thread
could help. How would you clear the control on the client
side?

Thanks in advance.
>-----Original Message-----
>Yep, its sounds like server side. So you may want to try
something like
>this:
>[C#]
>// get a reference to your form control
>Control frm = FindControl("YourFormID");
>foreach(Control ctrl in frm.Controls)
>{
> TextBox tb = ctrl as TextBox;
> if(ctrl!=null)
> tb.Text="";
>}
>
>--
>Victor Garcia Aprea
>Microsoft MVP | ASP.NET
>To contact me remove 'NOSPAM'. Please post all questions
to the newsgroup
>and not by private mail.
>
>
>"gkatkins" <nospam_mndipper@yahoo.com> wrote in message
>news:020f01c2adea$32aa0170$d4f82ecf@TK2MSFTNGXA11...
>> Good question. I suppose at the server side. There are
>> several dropdowns that are filled from database tables,
>> along with text boxes. Once the user chooses values from
>> the dropdowns, enters the textboxes and clicks the
Submit
>> button, I want the fields to clear the user choices to
>> allow a new time entry. So, would that be server side?
>>
>> George
>>
>> >-----Original Message-----
>> >Are you talking about clearing the field at the client-
>> side or at the
>> >server-side?
>> >
>> >--
>> >Victor Garcia Aprea
>> >Microsoft MVP | ASP.NET
>> >To contact me remove 'NOSPAM'. Please post all
questions
>> to the newsgroup
>> >and not by private mail.
>> >
>> >
>> >"gkatkins" <nospam_mndipper@yahoo.com> wrote in message
>> >news:027c01c2ad2c$36652600$d5f82ecf@TK2MSFTNGXA12...
>> >> What is the most effective way to clear a variety of
>> text
>> >> boxes and dropdowns after posting their contents to a
>> >> database, but without closing the form?
>> >>
>> >> I want to leave the form up for additional entries,
but
>> >> I'd like to have the previous choises removed so that
>> they
>> >> do not maintain the previous time entry. However, I'm
>> not
>> >> talking about removing data sources, of course.
>> >>
>> >> Thanks,
>> >> George Atkins
>> >
>> >
>> >.
>> >
>
>
>.
>

Newz

1/4/2003 11:37:00 AM

0

document.forms[0].reset();

"Jonathan Berry" <jonathan_berry_98@yahoo.com> wrote in message
news:018501c2b038$0e032720$d4f82ecf@TK2MSFTNGXA11...
> My problem is a little different but I think this thread
> could help. How would you clear the control on the client
> side?
>
> Thanks in advance.
> >-----Original Message-----
> >Yep, its sounds like server side. So you may want to try
> something like
> >this:
> >[C#]
> >// get a reference to your form control
> >Control frm = FindControl("YourFormID");
> >foreach(Control ctrl in frm.Controls)
> >{
> > TextBox tb = ctrl as TextBox;
> > if(ctrl!=null)
> > tb.Text="";
> >}
> >
> >--
> >Victor Garcia Aprea
> >Microsoft MVP | ASP.NET
> >To contact me remove 'NOSPAM'. Please post all questions
> to the newsgroup
> >and not by private mail.
> >
> >
> >"gkatkins" <nospam_mndipper@yahoo.com> wrote in message
> >news:020f01c2adea$32aa0170$d4f82ecf@TK2MSFTNGXA11...
> >> Good question. I suppose at the server side. There are
> >> several dropdowns that are filled from database tables,
> >> along with text boxes. Once the user chooses values from
> >> the dropdowns, enters the textboxes and clicks the
> Submit
> >> button, I want the fields to clear the user choices to
> >> allow a new time entry. So, would that be server side?
> >>
> >> George
> >>
> >> >-----Original Message-----
> >> >Are you talking about clearing the field at the client-
> >> side or at the
> >> >server-side?
> >> >
> >> >--
> >> >Victor Garcia Aprea
> >> >Microsoft MVP | ASP.NET
> >> >To contact me remove 'NOSPAM'. Please post all
> questions
> >> to the newsgroup
> >> >and not by private mail.
> >> >
> >> >
> >> >"gkatkins" <nospam_mndipper@yahoo.com> wrote in message
> >> >news:027c01c2ad2c$36652600$d5f82ecf@TK2MSFTNGXA12...
> >> >> What is the most effective way to clear a variety of
> >> text
> >> >> boxes and dropdowns after posting their contents to a
> >> >> database, but without closing the form?
> >> >>
> >> >> I want to leave the form up for additional entries,
> but
> >> >> I'd like to have the previous choises removed so that
> >> they
> >> >> do not maintain the previous time entry. However, I'm
> >> not
> >> >> talking about removing data sources, of course.
> >> >>
> >> >> Thanks,
> >> >> George Atkins
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >