Enable a button when all three text boxes are filled data

Discussion in 'ASP .Net Web Controls' started by ahmed k, Sep 25, 2010.

  1. ahmed k

    ahmed k Guest

    its looking old now bt for those searching still on this thread

    create method/function seperatly i call it "ckFields()"

    Private Sub ckFields()
    if textbox1.text <> "" and textbox2.text <> "" and textbox3.text <> "" then
    Button1.Enabled = True
    Else
    Button1.Enabled = False
    End If
    End Sub

    'Set AutoPostBack="true" for all textboxes
    'now call method/function on EVERY textBox's Text change Event

    Protected Sub textbox1_TextChanged(ByVal...)
    ckFields()
    End Sub

    Protected Sub textbox2_Te...
    Protected Sub textbox3_Te... and so on..

    This might help
    Thank you


    > On Thursday, February 25, 2010 2:44 PM aspfun via DotNetMonster.com wrote:


    > In a web page, there are three text boxes and one button (enable=false).
    >
    > When page load, I used javascrip to paste some info to fill out three text
    > boxes from clipboard in which another program will copy to.
    >
    > How to code to make the button enable = true only when all thee text boxes
    > are filled?
    >
    > I tried to add code below at end of page_load but do not work.
    >
    > if textbox1.text <> "" and textbox2.text <> "" and textbox3.text <> "" then
    > button1.enable = true
    >
    > --
    > Message posted via DotNetMonster.com
    > http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net-web-controls/201002/1



    >> On Thursday, February 25, 2010 6:42 PM Nathan Sokalski wrote:


    >> First of all, do you want to do this check client or server side? It sounds
    >> like something that you would want to do client-side using JavaScript. If
    >> you do it server-side in the Load event, the values of the TextBoxes' Text
    >> properties must be set before doing the check, and the Button's status will
    >> not change once the Page is rendered (unless you have something other
    >> client-side code that changes the Button's status). Please clarify exactly
    >> what you want.
    >> --
    >> Nathan Sokalski
    >>
    >> http://www.nathansokalski.com/



    >> Submitted via EggHeadCafe - Software Developer Portal of Choice
    >> Simple .NET HEX PixelColor Utility
    >> http://www.eggheadcafe.com/tutorial...f52bc1/simple-net-hex-pixelcolor-utility.aspx
     
    ahmed k, Sep 25, 2010
    #1
    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. Jeff Kiesel
    Replies:
    2
    Views:
    3,598
    Rick Spiewak
    Apr 23, 2004
  2. Lamine Darbouche

    Populating three list boxes from the database

    Lamine Darbouche, Oct 6, 2003, in forum: ASP General
    Replies:
    2
    Views:
    132
    Lamine Darbouche
    Oct 8, 2003
  3. Josh
    Replies:
    1
    Views:
    102
    Lasse Reichstein Nielsen
    Oct 23, 2003
  4. RelaxoRy
    Replies:
    1
    Views:
    133
    Geoff Tucker
    Feb 25, 2004
  5. Marc
    Replies:
    9
    Views:
    227
Loading...

Share This Page