Range and Required Validation

By Kateryna Sytnyk

January 21, 2009

 

Range Validation

 

  The available data types for OWS validations are:

  • Integer
  • Double
  • Currency
  • Date

 

All other types  everything is converted to String.

So be sure to mention TYPE in SPAN for every validation.

 

Example:

 

<span id="vTextValid"

controltovalidate="text1"

errormessage=""

display="Dynamic"

type="Integer"

evaluationfunction="RangeValidatorEvaluateIsValid"

minimumvalue = "0" maximumvalue = "15"

style="display: none; color: red;">

</span>

 


 

Required Field Validation

 

 

 

 

<span

controltovalidate="name"

 display="Dynamic" 

evaluationfunction="RequiredFieldValidatorEvaluateIsValid" 

Initialvalue = "" class="FormValidationError">*

</span>

 

 

Initialvalue is a REQUIRED field. The validation doesn't fire if the field is not included.

 

Initialvalue attribute Is used in the Required field validation as following:

 when the validation process  starts on the page the initial value is not considered as and entered value.

 

So, if we set

<input type = "text" id = "frmZip1" name = "frmZip1" value = "zip"/>

And in the validation:

initialvalue= "zip" 

 the text box will contain "zip" value on the page load, and will fail validation on  the submit button click.

 


 

Validation Summary

 

 

    <span

showsummary="True"

showmessagebox="False"

displaymode="BulletList"

headertext="Please correct the following things and re-submit the form:"

style="color:Red; display:none;" class="Normal">

</span>

 

Then all the text that was specified in errormessage attribute will be displayed in the summary.

 

DiplayMode Options:    

  • BulletList    Validation summary displayed in a bulleted list.
  • List    Validation summary displayed in a list.
  • SingleParagraph    Validation summary displayed in a single paragraph.

ShowMessageBox Options:

  • True if the validation summary is to be displayed in a message box; otherwise, false. The default is false.
  • This property can be used in addition to the ShowSummary property to control where the validation summary is displayed. If this property and EnableClientScript are both set to true, the validation summary is displayed in a message box. If EnableClientScript is set to false, this property has no effect.
  • If both the ShowMessageBox and ShowSummary properties are set to true, the validation summary is displayed in both a message box and on the Web page.

 

Average (1 Ratings):
 
Want to help out?
 
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seattle, WA • info@openwebstudio.com

Bookmark & Share Bookmark and Share