Ask a Question related to ASP.NET General, Design and Development.
-
Elliot Rodriguez #1
Re: Requiredfield validator
Sean:
I would use a CustomValidator for this. Using JavaScript its really easy to
detect if the first item in the dropdown box is selected.
Something like:
function isFirstPicked()
{
if (document.formname.dropdownlistname.selectedIndex == 0)
{
return false;
}
}
tie the function into your CustomValidator and you should be good to go.
HTH
--
Elliot M. Rodriguez, MCSD
*** It would take 227 cans of Mountain Dew to kill me***
"Sean" <ssmith@yahoo.com> wrote in message
news:OF3o%23k2VDHA.2168@TK2MSFTNGP09.phx.gbl...clicked,> Hi,
>
> I have 2 buttons A and B, textbox C and dropdown list D. When A isD> C is required field. When B is clicked, C and D are required fields. There
> is a dummy entry "please select" in the dropdown list. When B is clicked,enlighten> can't be the dummy option.
>
> I wonder what is the best practice for this case? I was thinking to use
> server-side validation for these controls, and created 2 RequiredField
> Validators and set them TRUE at designer. Is there anybody who can> me? Thanks.
>
>
>
Elliot Rodriguez Guest
-
validator qs.(1.5)
Hi, I have a field in the form for which I have to check that it should have some specific string e.g 1234. I tried using below it works if I... -
ANN: TMT Validator
This is my latest toy. It's not strictly DW related (not yet at least), but it can be handy to people that build web applications:... -
CheckBoxList RequiredField Validator
Hello All, I've been a taker of information from newsgroups for a long time and thought I'd finally make a contribution back to the community... -
Validator
Hi, I have a little problem with me form validation. When i run my page on the "Localhost" everything work fine, but when i run the page on... -
Help: Requiredfield validator
Hi, I have 2 buttons A and B, textbox C and dropdown list D. When A is clicked, C is required field. When B is clicked, C and D are required... -
Sean #2
Re: Requiredfield validator
I got the idea. Thank you.
"Elliot Rodriguez" <elliotmrodriguez@hotspammyspammail.com> wrote in message
news:#uHaOb3VDHA.2248@TK2MSFTNGP10.phx.gbl...to> Sean:
>
> I would use a CustomValidator for this. Using JavaScript its really easyThere> detect if the first item in the dropdown box is selected.
>
> Something like:
>
> function isFirstPicked()
> {
> if (document.formname.dropdownlistname.selectedIndex == 0)
> {
> return false;
> }
> }
>
> tie the function into your CustomValidator and you should be good to go.
>
> HTH
> --
> Elliot M. Rodriguez, MCSD
> *** It would take 227 cans of Mountain Dew to kill me***
>
>
>
> "Sean" <ssmith@yahoo.com> wrote in message
> news:OF3o%23k2VDHA.2168@TK2MSFTNGP09.phx.gbl...> clicked,> > Hi,
> >
> > I have 2 buttons A and B, textbox C and dropdown list D. When A is> > C is required field. When B is clicked, C and D are required fields.clicked,> > is a dummy entry "please select" in the dropdown list. When B is> D> enlighten> > can't be the dummy option.
> >
> > I wonder what is the best practice for this case? I was thinking to use
> > server-side validation for these controls, and created 2 RequiredField
> > Validators and set them TRUE at designer. Is there anybody who can>> > me? Thanks.
> >
> >
> >
>
Sean Guest



Reply With Quote

