Announcement

Collapse
No announcement yet.

CheckBox enables Textbox

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • CheckBox enables Textbox

    Hello
    I work with the CONTACT FORM of outlook 2003 and I've a little problem;
    I customized the "General" page of the CONTACT FORM.
    in this page I create by the Fields chooser two fields
    1. field "FTP". It is a checkbox and it can have the followings value : TRUE or FALSE
    2. field "Login". Login is a textbox.

    I want to do the following action:
    If FTP is TRUE 5 (i mean FTP.value==TrUE)
    Then Login is enable 5Login.enable==TRUE)
    Else Login is disable.

    Do you have an idea about the solution of this problem?

    thank you very much...

  • #2
    Re: CheckBox enables Textbox

    The rough script would be to use the "on change" event in the FTP checkbox, so something like:

    sub chkFTP_OnChange
    txtLogin.enabled = Not txtLogin.enabled
    end sub

    Assuming txtLogin is disabled (and chkFTP is off) by default, each click on chkFTP would reverse the enabled property of txtLogin
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Re: CheckBox enables Textbox

      Thnak you very much,
      but I'm a beginner and could you be more information about the code?

      Where do I have to write it? In the SCRIPT EDITOR or I have to use VISUAL BASIC EDITOR (ALT +F11)

      More
      Field "FTP"= checkbox1
      Field FTP login=textbox2

      So the code is

      sub checkbox1_OnChange
      textbox2.enabled = Not textbox2.enabled
      end sub

      is it correct?

      Thank again

      Comment

      Working...
      X