<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Client Side Web Development</title><link>http://forums.asp.net/130.aspx</link><description>Client-side programming discussions, including CSS, DHTML, JScript/Javascript, etc. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=18&amp;c=16" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: validation summary and javascript</title><link>http://forums.asp.net/thread/3274743.aspx</link><pubDate>Sat, 04 Jul 2009 14:49:33 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274743</guid><dc:creator>deepthoughts</dc:creator><author>deepthoughts</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274743.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3274743</wfw:commentRss><description>&lt;p&gt;If it solved your problem then please mark the post as answer :-)&lt;/p&gt;
&lt;p&gt;All the best&lt;/p&gt;</description></item><item><title>Re: validation summary and javascript</title><link>http://forums.asp.net/thread/3274736.aspx</link><pubDate>Sat, 04 Jul 2009 14:39:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274736</guid><dc:creator>saurabh.15in</dc:creator><author>saurabh.15in</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274736.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3274736</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thanks a lot...it solved my problem.....&lt;/p&gt;</description></item><item><title>Re: validation summary and javascript</title><link>http://forums.asp.net/thread/3274162.aspx</link><pubDate>Sat, 04 Jul 2009 03:02:47 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3274162</guid><dc:creator>deepthoughts</dc:creator><author>deepthoughts</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3274162.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3274162</wfw:commentRss><description>&lt;p&gt;Yes it will happen. Because when you return true in the onclick event of the save button, it will cause the form to be posted back to the server.&lt;/p&gt;
&lt;p&gt;So if you want to do some custom validations, you should go for asp:CustomValidator. &lt;/p&gt;
&lt;p&gt;Lets suppose you&amp;#39;ve a textbox named &amp;quot;txt1&amp;quot; and you want to put two validation controls on it. One is a RequiredFieldValidator and other a CustomValidator. Our CustomValidator will check if the length of the text is greater than 5. If it is not, an error message will be shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="xhtml" name="code"&gt;    &amp;lt;asp:TextBox ID=&amp;quot;txt1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:TextBox&amp;gt;
    &amp;lt;asp:RequiredFieldValidator ID=&amp;quot;RequiredFieldValidator1&amp;quot; runat=&amp;quot;server&amp;quot; ControlToValidate=&amp;quot;txt1&amp;quot; ErrorMessage=&amp;quot;Please enter text&amp;quot; ValidationGroup=&amp;quot;VG&amp;quot;&amp;gt;&amp;lt;/asp:RequiredFieldValidator&amp;gt;
    &amp;lt;asp:CustomValidator ID=&amp;quot;CustomValidator1&amp;quot; runat=&amp;quot;server&amp;quot; ControlToValidate=&amp;quot;txt1&amp;quot; ClientValidationFunction=&amp;quot;ValidateMe&amp;quot; ErrorMessage=&amp;quot;Text length must not be less than 5.&amp;quot; ValidationGroup=&amp;quot;VG&amp;quot;&amp;gt;&amp;lt;/asp:CustomValidator&amp;gt;
    
    &amp;lt;asp:Button ID=&amp;quot;btn1&amp;quot; runat=&amp;quot;server&amp;quot; Text=&amp;quot;Submit&amp;quot; ValidationGroup=&amp;quot;VG&amp;quot; CausesValidation=&amp;quot;true&amp;quot;  /&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;and the javascript method for doing the validation will be&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="xhtml" name="code"&gt;    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
        function ValidateMe(sender, args) {
            if (args.Value.length &amp;lt; 5) {
                args.IsValid = false;
                return;
            }
            args.IsValid = true;
    }
    &amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please refer to following link for more details.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.4guysfromrolla.com/articles/073102-1.aspx"&gt;http://www.4guysfromrolla.com/articles/073102-1.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;</description></item><item><title>validation summary and javascript</title><link>http://forums.asp.net/thread/3273668.aspx</link><pubDate>Fri, 03 Jul 2009 14:24:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3273668</guid><dc:creator>saurabh.15in</dc:creator><author>saurabh.15in</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3273668.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=130&amp;PostID=3273668</wfw:commentRss><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;on my save button..i am validating some fields using required field validator and some expression using javascript which returns true if succed.&lt;/p&gt;
&lt;p&gt;If the javascript returns true then my page is getting post back even if some fields are showing required field validator fails.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please suggest,&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Saurabh&lt;/p&gt;</description></item></channel></rss>