asp.net - Custom Validator -


I want to use a validator to compare 2 text boxes like this,

If the V text box is in 1, it means that the user should write prefix V of any number in textbox 2 (V00001 to V00050). In addition to V, if they type any other letter, it means that an error message should be shown.

Just like the C text box is in 1, then the user must type C00001 in text box 2. (Or any number C00001 to C00050) IF is in text box 1, it means that the user should type 00001 (S. 00001 to S.A. 200050)

thanks

Use this method:

  // C # public static block ISValid (string textbox 1 Text, string text box 2 text) {new system. Return the text. Regular Expression Reggae (@ "^" + Textbox 1 text + "000 [0-4] [0-9] $"). Ismail (text box 2 text) || String Ecloss (text box 2 text, textbox 1 text + "00050"); } 'VB Public Share Function Isvalid (By Text Text Box 1 as Text String, String as Byte Text Text Box) Boolean Returns as New System Text. Regular Expression Rezux ("^" + text box 1 text + "000 [0-4] [0-9] $") .IsMatch (textbox2text) Ores String.Aquals (Text box 2 text, textbox1 text + "00050") End Function  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -