Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Two simple validation questions

Reply
Thread Tools

Two simple validation questions

 
 
Alan Silver
Guest
Posts: n/a
 
      06-15-2006
Hello,

A couple fo questions about the easiest way to do some tasks. I'm sure
both of these can be done with custom controls, but can they be done
more easily with another validation control?

1) How would I go about building a validation control that checked that
a number was entered in a textbox only if a dropdown control was set to
a certain value? For example, say the dropdown allowed them to choose a
product, and product A requires a height entering, but none of the
others do. If they choose product A, they must enter a number, if they
choose any other product, they don't need to.

2) What if I want to require a textbox to be filled depending on the
value of another textbox? For example, if I have a textbox for customer
account number, then if they enter a number, they don't have to enter
their address as we will know it from their account. Non-customers would
not have an account number, so would leave the field blank and be
required to enter their address.

TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      06-17-2006
Sounds like you should use the CustomValidator and write all of this custom
logic in your page.

-Brock
http://staff.develop.com/ballen


> Hello,
>
> A couple fo questions about the easiest way to do some tasks. I'm sure
> both of these can be done with custom controls, but can they be done
> more easily with another validation control?
>
> 1) How would I go about building a validation control that checked
> that a number was entered in a textbox only if a dropdown control was
> set to a certain value? For example, say the dropdown allowed them to
> choose a product, and product A requires a height entering, but none
> of the others do. If they choose product A, they must enter a number,
> if they choose any other product, they don't need to.
>
> 2) What if I want to require a textbox to be filled depending on the
> value of another textbox? For example, if I have a textbox for
> customer account number, then if they enter a number, they don't have
> to enter their address as we will know it from their account.
> Non-customers would not have an account number, so would leave the
> field blank and be required to enter their address.
>
> TIA
>



 
Reply With Quote
 
 
 
 
Alan Silver
Guest
Posts: n/a
 
      06-19-2006
In article <(E-Mail Removed)> , Brock
Allen <(E-Mail Removed)> writes
>Sounds like you should use the CustomValidator and write all of this
>custom logic in your page.


That's what I thought, but I just wondered if I was missing some easy
way of doing it.

Thanks for the reply.

>-Brock
>http://staff.develop.com/ballen
>
>
>> Hello,
>> A couple fo questions about the easiest way to do some tasks. I'm
>>sure
>> both of these can be done with custom controls, but can they be done
>> more easily with another validation control?
>> 1) How would I go about building a validation control that checked
>> that a number was entered in a textbox only if a dropdown control was
>> set to a certain value? For example, say the dropdown allowed them to
>> choose a product, and product A requires a height entering, but none
>> of the others do. If they choose product A, they must enter a number,
>> if they choose any other product, they don't need to.
>> 2) What if I want to require a textbox to be filled depending on the
>> value of another textbox? For example, if I have a textbox for
>> customer account number, then if they enter a number, they don't have
>> to enter their address as we will know it from their account.
>> Non-customers would not have an account number, so would leave the
>> field blank and be required to enter their address.
>> TIA
>>

>
>


--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Two questions about style and some simple math Spoofy Python 2 01-20-2009 03:26 PM
How to compare two SOAP Envelope or two Document or two XML files GenxLogic Java 3 12-06-2006 08:41 PM
Two simple questions? NEWS HTML 6 12-19-2005 07:35 PM
two simple questions on CCNA ikrawal Cisco 2 11-28-2003 11:29 AM
Beginner: Two simple questions Floppy Java 4 07-14-2003 07:07 PM



Advertisments