Javascript and .Net Validation controls...

Discussion in 'ASP .Net' started by Roh, Feb 2, 2005.

  1. Roh

    Roh Guest

    Hi,

    Can we use Javascript and .Net Validation controls on the same page. If yes how?
    Please provide some examples which will help me a lot....thanks.
     
    Roh, Feb 2, 2005
    #1
    1. Advertising

  2. Sure you can.
    No problems.

    Do you want to validate the same control with both your own javascript and
    the .net Validation control ?
    You can just call up your own javascript validation when clicking on a
    button etc.
    Then if everything is fine there i guess you can do a form.submit() and pass
    control to .Net validation controls that always validate just before the
    postback and halts the postback if validation is not ok.

    Best regards Thue Tuxen






    "Roh" <> skrev i en meddelelse
    news:...
    > Hi,
    >
    > Can we use Javascript and .Net Validation controls on the same page. If

    yes how?
    > Please provide some examples which will help me a lot....thanks.
     
    Thue Sørensen, Feb 2, 2005
    #2
    1. Advertising

  3. <script language="javascript">
    function ConfirmDelete()
    {
    return confirm("Are you sure you want to delete this?");
    }
    </script>

    in code behind:
    btn.Attributes.Add("OnClick", "return ConfirmDelete();");

    Also you may use this in js function:

    if (!Page_ClientValidate ())
    return;
    if the validators don't pass the check, the function stops executing.

    Hope that helps!
    Regards,
    Kostadin Kostov


    You may use this code. If you click OK on the confirm window that pops up,
    then the validator controls will be checked if valid and if so, the form will
    be submitted by the Button btn.


    "Roh" wrote:

    > Hi,
    >
    > Can we use Javascript and .Net Validation controls on the same page. If yes how?
    > Please provide some examples which will help me a lot....thanks.
    >
     
    =?Utf-8?B?S29zdGFkaW4gS29zdG92?=, Feb 2, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Barrow
    Replies:
    2
    Views:
    5,578
    Chris Barrow
    Nov 7, 2003
  2. Matt
    Replies:
    14
    Views:
    4,140
    Chad Z. Hower aka Kudzu
    Jan 30, 2004
  3. =?Utf-8?B?ZGh1cndpdHo=?=
    Replies:
    1
    Views:
    474
    Teemu Keiski
    Apr 10, 2004
  4. baroque Chou
    Replies:
    4
    Views:
    442
    Peter Blum
    Jan 24, 2006
  5. Grigory Temchenko
    Replies:
    0
    Views:
    335
    Grigory Temchenko
    Dec 28, 2008
Loading...

Share This Page