how to enable the required validators in javascript

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: how to enable the required validators in javascript

    Jenet:

    Specify in the OnSubmit event of your FORM element the name of the
    javascript function you want to call.
    <form method=post onSubmit="return MyFormValidator();">

    --
    Elliot M. Rodriguez, MCSD
    *** It would take 227 cans of Mountain Dew to kill me***



    "Jenet" <Jenet@yahoo.com> wrote in message
    news:ekv8$85SDHA.2036@TK2MSFTNGP10.phx.gbl...
    > Hello,
    >
    > On the buton's onclick event, I need to call javascript function to enable
    a
    > required validators.
    >
    > Can someone point me to an article or code snippets that will can help me
    > with this?
    >
    > Thanks.
    >
    >

    Elliot Rodriguez Guest

  2. Similar Questions and Discussions

    1. Enable pdf tool from javascript
      Hi, I'm developing an air application that load pdf and I want to interact with pdf through my application user interface. Now I'm able to change...
    2. Validators Enable & Disable Issue
      Hi Guys , I have used few validators on few fields in my form, i have a reset button which reset the current contents of those fields. When i do...
    3. ASP.NET Required field validators
      Hi How can I stop a requiredfield validator from validating? The scenario is that my page has 2 modes "Add" & "Edit" I have a single form on...
    4. Required field validators do not while editing a row in a datagrid present in a composite control
      Hi All, I have created a composite control and I have added a datagrid in it. I am dynamically adding an edit column for editing the data. Now I...
    5. Validators and javascript
      How I can from client javascript know when one of my textboxes, Radio Button List, drop down box, etc... Validated to False when submitting the...
  3. #2

    Default Re: how to enable the required validators in javascript

    aaah using a RequiredFieldValidator... But why would you want to? Why not
    use the existing validator code?

    If youre concerned about lower level browsers being able to validate, then I
    would suggest rolling your own validator code into a client script, then
    using BrowserCaps to register it as required.

    --
    Elliot M. Rodriguez, MCSD
    *** It would take 227 cans of Mountain Dew to kill me***



    "Jenet" <Jenet@yahoo.com> wrote in message
    news:uy6dpX6SDHA.1552@TK2MSFTNGP10.phx.gbl...
    > Elliot,
    >
    > Thanks for your reply.
    >
    > I put a button on the page. When I click the button, I want to attach a
    > requiredfield validator. Is there a easy way to do it in javascript?
    >
    > Code behind file:
    > Protected WithEvents RequiredFieldValidator As
    > System.Web.UI.WebControls.RequiredFieldValidator
    >
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Load
    > ' It is NOT working.
    > btnSubmit.Attributes.Add("onclick",
    > "RequiredFieldValidator.enable=true")
    > End Sub
    >
    > Thanks.
    >
    >
    > "Elliot Rodriguez" <elliotmrodriguez@hotmail.comSPAM!> wrote in message
    > news:uXkCMG6SDHA.2768@tk2msftngp13.phx.gbl...
    > > Jenet:
    > >
    > > Specify in the OnSubmit event of your FORM element the name of the
    > > javascript function you want to call.
    > > <form method=post onSubmit="return MyFormValidator();">
    > >
    > > --
    > > Elliot M. Rodriguez, MCSD
    > > *** It would take 227 cans of Mountain Dew to kill me***
    > >
    > >
    > >
    > > "Jenet" <Jenet@yahoo.com> wrote in message
    > > news:ekv8$85SDHA.2036@TK2MSFTNGP10.phx.gbl...
    > > > Hello,
    > > >
    > > > On the buton's onclick event, I need to call javascript function to
    > enable
    > > a
    > > > required validators.
    > > >
    > > > Can someone point me to an article or code snippets that will can help
    > me
    > > > with this?
    > > >
    > > > Thanks.
    > > >
    > > >
    > >
    > >
    >
    >

    Elliot Rodriguez Guest

  4. #3

    Default Re: how to enable the required validators in javascript

    Jenet,

    The required field validator has a control to validate property.

    Try RequiredFieldValidator.ControlToValidate = [Control as String]

    --
    S. Justin Gengo
    Web Developer / Programmer

    Free Code Library At:
    [url]www.aboutfortunate.com[/url]

    "Out of chaos comes order."
    Nietzche


    "Jenet" <Jenet@yahoo.com> wrote in message
    news:uy6dpX6SDHA.1552@TK2MSFTNGP10.phx.gbl...
    > Elliot,
    >
    > Thanks for your reply.
    >
    > I put a button on the page. When I click the button, I want to attach a
    > requiredfield validator. Is there a easy way to do it in javascript?
    >
    > Code behind file:
    > Protected WithEvents RequiredFieldValidator As
    > System.Web.UI.WebControls.RequiredFieldValidator
    >
    > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
    > System.EventArgs) Handles MyBase.Load
    > ' It is NOT working.
    > btnSubmit.Attributes.Add("onclick",
    > "RequiredFieldValidator.enable=true")
    > End Sub
    >
    > Thanks.
    >
    >
    > "Elliot Rodriguez" <elliotmrodriguez@hotmail.comSPAM!> wrote in message
    > news:uXkCMG6SDHA.2768@tk2msftngp13.phx.gbl...
    > > Jenet:
    > >
    > > Specify in the OnSubmit event of your FORM element the name of the
    > > javascript function you want to call.
    > > <form method=post onSubmit="return MyFormValidator();">
    > >
    > > --
    > > Elliot M. Rodriguez, MCSD
    > > *** It would take 227 cans of Mountain Dew to kill me***
    > >
    > >
    > >
    > > "Jenet" <Jenet@yahoo.com> wrote in message
    > > news:ekv8$85SDHA.2036@TK2MSFTNGP10.phx.gbl...
    > > > Hello,
    > > >
    > > > On the buton's onclick event, I need to call javascript function to
    > enable
    > > a
    > > > required validators.
    > > >
    > > > Can someone point me to an article or code snippets that will can help
    > me
    > > > with this?
    > > >
    > > > Thanks.
    > > >
    > > >
    > >
    > >
    >
    >

    S. Justin Gengo Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139