Validation Controls and Javascript Validation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • farnena
    New Member
    • Nov 2009
    • 3

    Validation Controls and Javascript Validation

    Hi All

    I have an issue in my application . When I am calling a Javascript function OnClick of Submit button, the range validators on my page doesnt work.
    How do I solve this Issue...????
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    What are you doing to call the JavaScript method?
    Are you doing something like:

    Code:
    <asp:Button ID="MyButton" runat="server" OnClientClick="[b]return myJSMethod();[/b]" />
    If so, then any JavaScript calls that come after your call (like the Validation JavaScript) will not be executing since you're "returning" before it is executed.

    -Frinny

    Comment

    • farnena
      New Member
      • Nov 2009
      • 3

      #3
      Thanks Frinny. I removed "return" and it worked.

      Comment

      Working...