Work With Web Controls

TYPE THIS:

<FONT FACE ="Verdana">

<H3>Welcome to mylifetimegoals.com</H3> Please help us by taking the following survey. <FORM RUNAT="Server">

How many goal-setting sites have visited you this month? <ASP:TEXTBOX IEfc"inputTimesVisitedGoalSites" TEXTMODE="SingleLine" TEXT="" WIDTH=n50px" RUNAT="Server"/> <BR/>

How many visits to www.mylifetimegoals.com this month? <ASP:TEXTBOX IEfc"inputTimesVisitedMyLifetimeGoals" TEXTMODE="SingleLine" TEXT="" WIDTH="50px" RUNAT="Server"/> <P/><ASP:BUTTON TEXT="Submit" RUNAT="Server"/><P/> <ASP:COMPAREVALIDATOR IEfc"comparevalidatorInputName" CONTROLTOVALIDATE=ninputTimesVisitedMyLifetimeGoalsn

CONTROLTOCOMPARE = "inputTimesVisitedGoalSites" OPERATOR="Equal" TYPE="String"

TEXT="Answer 1 must equal to Answer 2." RUNAT="Server"/>

RESULT:

The result is a page that collects values for two questions. When the form is submitted, it checks to see if the values in the two text boxes are equal. If they are not equal, then a message is displayed.

L-0 Within the CompareValidator control, set the validation message by specifying the TEXT attribute.

, Save the file and request it from the Web server.

Note: See pages 20 to 25 for instructions on saving a file to the Web server and then requesting the file using the IIS Admin.

Fill in the form with a smaller number for the first question.

-■ A validation message appears.

Was this article helpful?

0 0

Post a comment