Baby JavaScript question

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

  1. #1

    Default Baby JavaScript question

    I never ever need to use Javascript, but in this case I think I do. All I
    want is for a Calendar control to appear when the user clicks a button.
    Being as this isn't worth a trip to the server, I want to add some JS to
    make this happen. What is the script for that? I tried:

    MyButton.Attributes.Add("onclick","document.forms[0].MyCalendar.Visible='Tru
    e';");

    Though of course I don't know what I'm doing.

    --
    - Jim Owen
    206-501-6936


    Jim Owen Guest

  2. Similar Questions and Discussions

    1. JavaScript Question
      I have a hidden field on a form used for the server. It submits an email address to the server. The server then process the form (through cgi-bin)...
    2. [Announce] Canada's Premier PHP Conference has a new baby sister
      From the people who bring you php|architect every month, the worlds foremost PHP Magazine available in PDF and Print Editions, Marco Tabini and...
    3. JavaScript code question
      I have had some trouble with this code. This is the code I used to tie in the street address with the combo box selection: var gstreet = new Array...
    4. About Lycoris Linux installation/internet connection (new baby q.)
      Juha Kettunen scribbled: Since you admit to not knowing much about GNU/Linux I would recommend the easiest route for you and your friend to...
    5. Javascript Question...
      Hi guys, Just wondering the following. If i have a page like hello.html?id=hi Can I use the variable "id" to call an script include? So for...
  3. #2

    Default Re: Baby JavaScript question

    Hi

    This should toggle the element visibility passed to the function

    function toggleElement(sElementID){
    if(document.getElementById)
    {
    var e = document.getElementById(sElementId);
    if( e != null ) e.style.visibility = ( e.style.visibility == "hidden") ?
    "visible" : "hidden";
    }
    }

    MyButton.Attributes.Add("onclick","toggleElement(' ELEMENTID')" );
    Where ELEMENTID is the calendar in your case

    --
    Best Regards
    Vidar Petursson
    ==============================
    Microsoft Internet Client & Controls MVP
    ==============================
    "Jim Owen" <jkoseattle@comcast.net> wrote in message
    news:On8FvJUUDHA.2088@TK2MSFTNGP10.phx.gbl...
    > I never ever need to use Javascript, but in this case I think I do. All I
    > want is for a Calendar control to appear when the user clicks a button.
    > Being as this isn't worth a trip to the server, I want to add some JS to
    > make this happen. What is the script for that? I tried:
    >
    >
    MyButton.Attributes.Add("onclick","document.forms[0].MyCalendar.Visible='Tru
    > e';");
    >
    > Though of course I don't know what I'm doing.
    >
    > --
    > - Jim Owen
    > 206-501-6936
    >
    >

    Vidar Petursson 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