VBScript - Hide Text Field

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default VBScript - Hide Text Field

    I am trying to hide a text field using VBscript

    ***
    if firstname = "test" Then
    msgbox ("hello")
    form.txtlastname.visible = fales
    end if
    ***

    The message box appears correctly if I enter test, but I am unable to
    hide the textfield. I've tried a million different things, would
    appreciate it if some one could point me in the right direction.

    thanks

    Allyn J

    *** Sent via Devdex [url]http://www.devdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Allyn Jefferies Guest

  2. Similar Questions and Discussions

    1. Hide/show field and its label in flash form
      I was able to hide the textbox using _visible=false but the label continues to show. Also, is there such thing as in CSS using display to not only...
    2. Radio btn makes text field equal value of different text field
      What I am trying to do is when someone clicks on the YES radio button I want the text field called MYTEXT to equal the text field named DATE. The...
    3. Help. I need a Script to Hide field if field equals zero
      I have a calculated field that I want to hide if it equals zero. Can anyone help? Thanks, Ken
    4. Can't hide Input Text field, please help
      Hello all, In one of my frames, I have Dynamic and Input Text fields. Say that I have the Title1(Dynamic) and EMail(Input) fields. If I use the...
    5. can you hide scroll bars on a scrolling text field?
      thanks! I love simple solutions like that. Ned wrote:
  3. #2

    Default Re: VBScript - Hide Text Field

    Allyn Jefferies wrote:
    > I am trying to hide a text field using VBscript
    >
    > ***
    > if firstname = "test" Then
    > msgbox ("hello")
    > form.txtlastname.visible = fales
    > end if
    > ***
    >
    > The message box appears correctly if I enter test, but I am unable to
    > hide the textfield. I've tried a million different things, would
    > appreciate it if some one could point me in the right direction.
    >
    This is client-side code and as such, has nothing to do with asp. Please
    follow-up on a dhtml or scripting newsgroup, where dhtml questions such as
    this are routinely handled.

    Your problem is that you did not realize that you were dealing with another
    object model that is separate from the vbscript object collection, and
    therefore failed to read the "document object model" documentation which is
    freely available at [url]http://msdn.microsoft.com/library[/url], or at a myriad of
    other websites which can be found by a Google search for DOM, DHTML, or
    "Document Object Model". The documentation will reveal that INPUT elements
    (as well as all the other DOM objects) have no "visible" property. Instead,
    they have a style object, one of whose properties is called "visibility",
    the details of which can be found here:
    [url]http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/visibility.asp[/url].

    form.txtlastname.style.visibility="hidden"

    HTH,
    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows [MVP] Guest

  4. #3

    Default Re: VBScript - Hide Text Field


    Bob,

    thanks for that, works like a dream.

    Allyn J


    *** Sent via Devdex [url]http://www.devdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Allyn Jefferies 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