ANSWER:

This was being caused by the onclick event posting back, which the
validate plugin had disabled. I changed the behavior of my radio
buttons onclick method to get around this.

On Mar 2, 1:16 pm, BSpizzle <spar...@djsparrow.com> wrote:
> Hello all,
>
> I am using the jQuery Validate plugin (http://docs.jquery.com/Plugins/
> Validation) and am running into an issue with the other javascript I
> need to have running on the page. I have an Onclick event wired into a
> radio button in the form, but when one of the required fields fails
> validation, the radio button onclick event listed here is completely
> disabled and even when the validation requirement is met and the
> submit button is re-enabled, the other form javascript remains
> disabled:
>
> onclick="javascript:setTimeout('__doPostBack(\'_ctl0$ContentPlaceHolder
> $B\',\'\')', 0)"
>
> I am using ASP.Net to generate my pages so unfortunately I am mostly
> at their discretion on how certain behavior is performed, but one of
> the things that I NEED to have work on the page is my autopostback
> features on my radio buttons. I do not have the radio buttons with a
> required class indicating that they should be part of this, but I do
> need their form submission values and since it's ASP.Net, the whole
> page is the form, so I can't just leave it outside and cheat with
> hidden values.
>
> I am newer to Jquery, so I have tried two different things in
> attempting to keep the javascript onclick event from being
> disabled: .filter and .not .  .fliter seems to completely disable the
> entire form validation and let anything slide, and .not just isn't
> doing anything.  Is there a way to have my cake and eat it too using
> this excellent plugin?
>
> Here is what I have in the javascript/jquery:
>
> <script type="text/javascript">
> $(document).ready(function() {
> var a = '_ctl0_ContentPlaceHolder_a';
> var b = '_ctl0_ContentPlaceHolder_b';
> var c = '_ctl0_ContentPlaceHolder_c';
>
> $("#aspnetForm").not(document.getElementById(a),
> document.getElementById(b), document.getElementById(c)).validate();});
>
> </script>
>
> Here is what's in the html:
>
> <form name="aspnetForm" method="post" action="SamePage.aspx"
> id="aspnetForm" onsubmit="return (g_submitted ? false : (g_submitted =
> true));">
>
> <input id="_ctl0_ContentPlaceHolder_a" type="radio"
> name="_ctl0:ContentPlaceHolder:OPTION" value="A"
> onclick="javascript:setTimeout('__doPostBack(\'_ctl0$ContentPlaceHolder
> $A\',\'\')', 0)" language="javascript" /><label>A</label>
>                                         <br />
> <input id="_ctl0_ContentPlaceHolder_b" type="radio"
> name="_ctl0:ContentPlaceHolder:OPTION" value="multiplePassword"
> checked="checked" onclick="javascript:setTimeout('__doPostBack
> (\'_ctl0$ContentPlaceHolder$B\',\'\')', 0)" language="javascript" 
> /><label>B</label>
>
>                                         <br />
> <input id="_ctl0_ContentPlaceHolder_c" type="radio"
> name="_ctl0:ContentPlaceHolder:OPTION" value="C"
> onclick="javascript:setTimeout('__doPostBack(\'_ctl0$ContentPlaceHolder
> $C\',\'\')', 0)" language="javascript" /><label>C</label>
>
> <input class="required" name="blah" minlength="1" />
> submit button    cancel button  etc...
> </form>
>
> Everything else seems to work great, any thoughts?

Reply via email to