Solved

UpdatePanel and Required field validator: shows error even though field filled?

Posted on 2011-09-05
8
776 Views
Last Modified: 2012-05-12
This should be simple, but I am getting nowhere!

I have a simple form.  When I fill it in, the required field validator displays an error even though the field in question has a value in it.

Also, I am using an open source component (http://sourceforge.net/projects/html5asp/files/) that extends the basic field types with HTML5 features.  The telephone number field in my form uses the PhoneInput control, and when the page posts back this control loses its value, as does the two email fields.

If I remove the UpdatePanel, the validation works.

What am I not spotting??!

Thanks!
0
Comment
Question by:Hairbrush
  • 3
8 Comments
 
LVL 22

Expert Comment

by:plusone3055
ID: 36484867
need the update panel and content template outside the form


    </form>
</ContentTemplate>
    </asp:UpdatePanel>
0
 
LVL 12

Author Comment

by:Hairbrush
ID: 36484901
That doesn't sound right to me?

If I try that, I get:

Control 'UpdatePanel1' of type 'UpdatePanel' must be placed inside a form tag with runat=server
0
 
LVL 14

Expert Comment

by:shahprabal
ID: 36524954
Are you able to turn on enable viewstate on the custom control ? Maybe try using the update panel with a regular textbox and see if the that works. If it does then that narrows it down to the third party control. Is there any code that clears the phone input box? maybe put a breakpoint and check when/how many times its called. Also please attach the source code if you can.

Also, you probably are using the latest version of the toolkit but you may want to double check that :
http://ajaxcontroltoolkit.codeplex.com/ since their latest version was released in july.
0
 
LVL 12

Accepted Solution

by:
Hairbrush earned 0 total points
ID: 37206528
This turned out to be because of a bug in the AJAX control toolkit.  If using HTML5 input controls in conjunction with the toolkit and an update panel, the javascript that performs the validation doesn't work.  See http://ajaxcontroltoolkit.codeplex.com/workitem/27041
0
 
LVL 12

Author Closing Comment

by:Hairbrush
ID: 37233364
Solved the problem myself.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now