Forum  General Visual ...  Visual WebGui v...  Failed validation renders 2 pop-ups
Previous Previous
 
Next Next
New Post 11/1/2011 10:31 PM
  gaagaagui
24 posts
No Ranking


Failed validation renders 2 pop-ups 

Hello.  I have the following line in a textbox's TextChanged event handler:

textboxname.Validator = New TextBoxValidation("String(value).match(/^\d{1}$/)", "Bad value", "0-9")

Why am I getting 2 "Bad value" pop-ups instead of one when the validation fails?  Thank you.

 
New Post 11/12/2011 6:25 AM
  palli
11838 posts
1st Level Poster




Re: Failed validation renders 2 pop-ups 

Hi gaagaagui,

I need a sample application to understand why you get two pop-ups, as there must be some more details missing that are relevant for this scenario. Adding a single textbox with just this code on TextChanged only produces one popup when tested here on IE9.

You should realize though, that setting the Validator on TextChanged is too late for the current input and will only work for next text change on that textbox. The reaons for this is that the Validator is a client-side creature, so setting the Validator will require one roundtrip to the server for it to be effective client-side. You can easily test this with a blank form with a TextBox and your code in the TextChanged event handler. The first time you provide invalid input, no popup occurs, but the second time, it does.

Hope this explains,

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 11/17/2011 5:50 PM
  jadehua
2 posts
No Ranking


Re: Failed validation renders 2 pop-ups 

 hi gaagaagui

       I also met this situation,did not know that you solved it? 

 
 
New Post 11/19/2011 6:59 AM
  palli
11838 posts
1st Level Poster




Re: Failed validation renders 2 pop-ups 

Hi jadehua,

Welcome to Visual WebGui

Did my reply to gaagaagui help you with your case ?

Palli


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 12/27/2011 7:14 AM
  roi972
61 posts
No Ranking


Re: Failed validation renders 2 pop-ups 

 I have also encountered this problem.

To reproduce : 

1.Create new project.

2.Add a textbox.

3.Set the textbox's Validation property to: TextBoxValidation.IntegerValidator (either in the designer, or right after InitializeComponent())

4.Run the app.

5. Paste some text (letters etc..) into the textbox and move focus out of the textbox

6. Get two popups instead of one saying "Integer value is required"

Thanks, 

Roi

 
Previous Previous
 
Next Next
  Forum  General Visual ...  Visual WebGui v...  Failed validation renders 2 pop-ups
CompanionKit Bottom
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS