anyway to do this without post back to server

anyway to do this without post back to server

am 11.04.2008 23:08:05 von Paul

Hi I have a dropdown box with entries like

AY Activity Yellow
AB Activity Blue
AR Activity Red

This dropdown is followed by two text boxes and when the user selects AY I
would like to display the following in the text boxes

txbx1 [AY] txbx2 [Activity Yellow]
for AB Activity Blue
txbx1 [AB] txbx2 [Activity Blue]
So I am just spliting the string and displaying portions in each text box.
I was just wondering if there is a way to do this without posting back the
server on the dropdown SelectedIndexChanged event?
Thanks

--
Paul G
Software engineer.

RE: anyway to do this without post back to server

am 12.04.2008 00:09:02 von brucebarker

yes, its simple javascript.



then in codebehind:

myDropDowm.Attributes["onchange"] = "doDropChange(this)";


-- bruce (sqlwork.com)


"Paul" wrote:

> Hi I have a dropdown box with entries like
>
> AY Activity Yellow
> AB Activity Blue
> AR Activity Red
>
> This dropdown is followed by two text boxes and when the user selects AY I
> would like to display the following in the text boxes
>
> txbx1 [AY] txbx2 [Activity Yellow]
> for AB Activity Blue
> txbx1 [AB] txbx2 [Activity Blue]
> So I am just spliting the string and displaying portions in each text box.
> I was just wondering if there is a way to do this without posting back the
> server on the dropdown SelectedIndexChanged event?
> Thanks
>
> --
> Paul G
> Software engineer.

RE: anyway to do this without post back to server

am 12.04.2008 00:38:02 von Paul

Thanks it works. For the code behind I used
if (!Page.IsPostBack)
{
this.dropdown.Attributes["onchange"] = "doDropChange(this)";
}
--
Paul G
Software engineer.


"bruce barker" wrote:

> yes, its simple javascript.
>
>
>
> then in codebehind:
>
> myDropDowm.Attributes["onchange"] = "doDropChange(this)";
>
>
> -- bruce (sqlwork.com)
>
>
> "Paul" wrote:
>
> > Hi I have a dropdown box with entries like
> >
> > AY Activity Yellow
> > AB Activity Blue
> > AR Activity Red
> >
> > This dropdown is followed by two text boxes and when the user selects AY I
> > would like to display the following in the text boxes
> >
> > txbx1 [AY] txbx2 [Activity Yellow]
> > for AB Activity Blue
> > txbx1 [AB] txbx2 [Activity Blue]
> > So I am just spliting the string and displaying portions in each text box.
> > I was just wondering if there is a way to do this without posting back the
> > server on the dropdown SelectedIndexChanged event?
> > Thanks
> >
> > --
> > Paul G
> > Software engineer.