Solved

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

Posted on 2011-09-05
8
793 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

752 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