Hide / unhide dropdownlist in DateTime Picker

I am writing an ASP.NET application and using javascript DateTime Picker code (I have found it on the Internet):
<script type="text/javascript">
// <!-- <![CDATA[
// Code begin...
// Set the initial date.
var ds_i_date = new Date();
ds_c_month = ds_i_date.getMonth() + 1;
ds_c_year = ds_i_date.getFullYear();
// Get Element By Id
function ds_getel(id) {
    return document.getElementById(id);
// Get the left and the top of the element.
function ds_getleft(el) {
    var tmp = el.offsetLeft;
    el = el.offsetParent
    while(el) {
        tmp += el.offsetLeft;
        el = el.offsetParent;
    return tmp;
function ds_gettop(el) {
    var tmp = el.offsetTop;
    el = el.offsetParent
    while(el) {
        tmp += el.offsetTop;
        el = el.offsetParent;
    return tmp;
// Output Element
var ds_oe = ds_getel('ds_calclass');
// Container
var ds_ce = ds_getel('ds_conclass');
// Output Buffering
var ds_ob = '';
function ds_ob_clean() {
    ds_ob = '';
function ds_ob_flush() {
    ds_oe.innerHTML = ds_ob;
    ds_ob_clean();
function ds_echo(t) {
    ds_ob += t;
var ds_element; // Text Element...
var ds_monthnames = [
'Jan', 'Feb', 'Mars', 'Apr', 'Mai', 'Jun',
'Jul', 'Agu', 'Sep', 'Okt', 'Nov', 'Des'
]; // You can translate it for your language.
var ds_daynames = [
'Sun', 'Man', 'Tue', 'Wen', 'Thu', 'Fri', 'Sat'
]; // You can translate it for your language.
// Calendar template
function ds_template_main_above(t) {
    return '<table cellpadding="3" cellspacing="1" class="ds_tbl">'
         + '<tr>'
         + '<td class="ds_head" style="cursor: pointer" onclick="ds_py();"><<</td>'
         + '<td class="ds_head" style="cursor: pointer" onclick="ds_pm();"><</td>'
         + '<td class="ds_head" style="cursor: pointer" onclick="ds_hi();" colspan="3">[Close]</td>'
         + '<td class="ds_head" style="cursor: pointer" onclick="ds_nm();">></td>'
         + '<td class="ds_head" style="cursor: pointer" onclick="ds_ny();">>></td>'
         + '</tr>'
         + '<tr>'
         + '<td colspan="7" class="ds_head">' + t + '</td>'
         + '</tr>'
         + '<tr>';
function ds_template_day_row(t) {
    return '<td class="ds_subhead">' + t + '</td>';
    // Define width in CSS, XHTML 1.0 Strict doesn't have width property for it.
function ds_template_new_week() {
    return '</tr><tr>';
function ds_template_blank_cell(colspan) {
    return '<td colspan="' + colspan + '"></td>'
function ds_template_day(d, m, y) {
    return '<td class="ds_cell" onclick="ds_onclick(' + d + ',' + m + ',' + y + ')">' + d + '</td>';
    // Define width the day row.
function ds_template_main_below() {
    return '</tr>'
         + '</table>';
// This one draws calendar...
function ds_draw_calendar(m, y) {
    // First clean the output buffer.
    ds_ob_clean();
    // Here we go, do the header
    ds_echo (ds_template_main_above(ds_monthnames[m - 1] + ' ' + y));
    for (i = 0; i < 7; i ++) {
        ds_echo (ds_template_day_row(ds_daynames));
// Make a date object.
var ds_dc_date = new Date();
ds_dc_date.setMonth(m - 1);
ds_dc_date.setFullYear(y);
ds_dc_date.setDate(1);
if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {
days = 31;
} else if (m == 4 || m == 6 || m == 9 || m == 11) {
days = 30;
} else {
days = (y % 4 == 0) ? 29 : 28;
var first_day = ds_dc_date.getDay();
var first_loop = 1;
// Start the first week
ds_echo (ds_template_new_week());
// If sunday is not the first day of the month, make a blank cell...
if (first_day != 0) {
ds_echo (ds_template_blank_cell(first_day));
var j = first_day;
for (i = 0; i < days; i ++) {
// Today is sunday, make a new week.
// If this sunday is the first day of the month,
// we've made a new row for you already.
if (j == 0 && !first_loop) {
// New week!!
ds_echo (ds_template_new_week());
// Make a row of that day!
ds_echo (ds_template_day(i + 1, m, y));
// This is not first loop anymore...
first_loop = 0;
// What is the next day?
j ++;
j %= 7;
// Do the footer
ds_echo (ds_template_main_below());
// And let's display..
ds_ob_flush();
// Scroll it into view.
ds_ce.scrollIntoView();
// A function to show the calendar.
// When user click on the date, it will set the content of t.
function ds_sh(t) {
document.form1.dropDownList.display = false; //this line not working
// Set the element to set...
ds_element = t;
// Make a new date, and set the current month and year.
var ds_sh_date = new Date();
ds_c_month = ds_sh_date.getMonth() + 1;
ds_c_year = ds_sh_date.getFullYear();
// Draw the calendar
ds_draw_calendar(ds_c_month, ds_c_year);
// To change the position properly, we must show it first.
ds_ce.style.display = '';
// Move the calendar container!
the_left = ds_getleft(t);
the_top = ds_gettop(t) + t.offsetHeight;
ds_ce.style.left = the_left + 'px';
ds_ce.style.top = the_top + 'px';
// Scroll it into view.
ds_ce.scrollIntoView();
// Hide the calendar.
function ds_hi() {
ds_ce.style.display = 'none';
document.form1.dropDownList.display = true; //this line not working
// Moves to the next month...
function ds_nm() {
// Increase the current month.
ds_c_month ++;
// We have passed December, let's go to the next year.
// Increase the current year, and set the current month to January.
if (ds_c_month > 12) {
ds_c_month = 1;
ds_c_year++;
// Redraw the calendar.
ds_draw_calendar(ds_c_month, ds_c_year);
// Moves to the previous month...
function ds_pm() {
ds_c_month = ds_c_month - 1; // Can't use dash-dash here, it will make the page invalid.
// We have passed January, let's go back to the previous year.
// Decrease the current year, and set the current month to December.
if (ds_c_month < 1) {
ds_c_month = 12;
ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.
// Redraw the calendar.
ds_draw_calendar(ds_c_month, ds_c_year);
// Moves to the next year...
function ds_ny() {
// Increase the current year.
ds_c_year++;
// Redraw the calendar.
ds_draw_calendar(ds_c_month, ds_c_year);
// Moves to the previous year...
function ds_py() {
// Decrease the current year.
ds_c_year = ds_c_year - 1; // Can't use dash-dash here, it will make the page invalid.
// Redraw the calendar.
ds_draw_calendar(ds_c_month, ds_c_year);
// Format the date to output.
function ds_format_date(d, m, y) {
// 2 digits month.
m2 = '00' + m;
m2 = m2.substr(m2.length - 2);
// 2 digits day.
d2 = '00' + d;
d2 = d2.substr(d2.length - 2);
// DD.MM.YYY
return d2 + '.' + m2 + '.' + y;
// When the user clicks the day.
function ds_onclick(d, m, y) {
// Hide the calendar.
ds_hi();
// Set the value of it, if we can.
if (typeof(ds_element.value) != 'undefined') {
ds_element.value = ds_format_date(d, m, y);
// Maybe we want to set the HTML in it.
} else if (typeof(ds_element.innerHTML) != 'undefined') {
ds_element.innerHTML = ds_format_date(d, m, y);
// I don't know how should we display it, just alert it to user.
} else {
alert (ds_format_date(d, m, y));
// And here is the end.
// ]]> -->
<!--DateTime Picker code-->
</script>
Also I have to use DropDownList below this DateTime Picker. In the IE 6.0 "DropDownList" control comes in front of this calendar (this is a known problem in IE 6.0, that is form items appear infront of all other).
And now I am trying to hide the form items as the DateTime Picker is shown and display them again as the calendar is closed. For this action I am using:
document.form1.dropDownList.display = true / false in the "function ds_sh(t)" and "function ds_hi()"
but its not working (not hide or unhide, no action).
Maybe somebody could help me in this situation.
Thanks in advance.
br,
Forumaic

I replaced these to lines that not worked in the DateTime picker with this one:
var obj = document.getElementById('ddlTest');
    obj.style.visibility = "visible";
var obj = document.getElementById('ddlTest');
    obj.style.visibility = "hidden";And now everything working like it should be.
Forumaic.

Similar Messages

  • How to Dynamically Hide-Unhide Report Details

    Is there a technique to hide/unhide data?
    I am creating a report that summarizes transaction data. The users want the opportunity to review the details behind the summary as the report is being reviewed.
    Is there a way to hide the detail data while providing a mechanism for the reviewer to view the detail as desired?
    TIA

    I have implemented this in BI Publisher enterprise and using the desktop version and I don't get this error..
    I did come across another thread that discusses this error. R12: Namespace prefix 'dhtml' used but not declared.
    Not sure if that addresses your setup and issue.. You can send me your template to [email protected] if you would like me to take a look.
    Thanks!

  • How to Hide / Unhide iGrid Applet

    I'm attempting to develop an irpt page which will feature two grids / applets.  The topmost grid will be visible upon initial load of the page.  Upon selecting a record from the top grid, I'd like to then unhide the bottom grid so that a user may select a row from it before then calling another page.
    I've tried all of the following methods to hide / unhide the grid but none appear to be working:
    1)  Set the style.display of the applet to 'none' and then set it to 'inline' after row selection of the top grid.
    2)  Set the column widths of the bottom iGrid to 0 and then use the document.iGrid-applet.ColumnWidths=x,y JS command after row selection of the top grid.
    3)  Set the initial width of the iGrid applet to 1 X 1 and then use the document.getElementById("applet-iGrid").style.width / height = 'xxxpx' after row selection of the top grid.
    None of these solutions work.  It appears that once the iGrid applet is loaded, none of these properties may then be utilized to change it's appearance.
    How can hide upon load and then subsequently unhide an iGrid applet??
    Thanks in advance,
    Randy

    Thanks Udayan - this worked. 
    Only other tidbit was that it appears you first have to set the style display to inline in the div tag (to ensure all subsequent object references to the grid are valid). 
    Then in the function called by the update event of your top iGrid applet, you have to hide the bottom iGrid/applet with the style="display:none" command.
    Then in the function called by the selection event of your top iGrid applet, you have to unhide the bottom iGrid/applet with the style="display:inline" command.
    This ensures the applet is first displayed (so that all references to the grid object are valid), hide it when the first (top) grid is displayed, and then unhide it when a row is selected from the first (top) grid.
    Thanks again,
    Randy

  • Hide/Unhide Button on a Custom Form?

    Hello!  I am looking for some ideas regarding the ability to hide/unhide a button on a custom form.  Ideally, I would like to create an authorization group, if a user is a member of the authorization group, they can see the button, if not, the button is hidden.  Is this something that can be done?  If not, does anyone have another way of doing this?  Thank you.

    Are you asking specifically for Smartforms, SAPforms, Interactive Adobe forms? Or generally about UI programming?
    Generally yes, this is possible and is also often done to give the user a more friendly interface to work with (without having to click on buttons, only to discover that they cannot use it anyway).
    Many standard transactions are developed in this way.
    Cheers,
    Julius

  • Hide/Unhide Column in WAD via Button

    Hi,
    I would like to create a Button in WAD that hides or unhides a certain column (key figure) from a DP in the WebReport. What is the INSTRUCTION to Hide/Unhide a column?
    Thanks for your help!

    Hi Andreas,
    Use Generic Navigation Block to hide or unhide a keyfigure.
    Use generic Navigation web item
    Assign the report to the data provider
    After execution select the navigation block and select the keyfigures and uncheck the check box for the keyfigure to be hidden.
    Regards
    RaM

  • HOW DO I HIDE & UNHIDE APPS PURCHASED IN APPS STORE PURCHASES LIST ON MY MAC

    HOW DO I HIDE & UNHIDE APPS PURCHASED IN APPS STORE PURCHASES LIST ON MY MAC? MAVERICKS 10.9.5...

    You need to reach level 3 (500 points) to add a custom avatar.
    As you collect reputation points, your status level increases and you receive additional privileges.
    Level
    Points
    Privilege
    1
    0
    2
    150
    Report posts
    3
    500
    Upload a custom avatar
    4
    1,000
    Attend conference calls
    5
    4,000
    Create User Tips
    6
    8,000
    Access the virtual MVP lounge. Attend in-person Communities meetups.
    7
    20,000
    8
    35,000
    9
    50,000
    10
    80,000+

  • Hide unhide rolemenu in web with only one link

    Hi together
    is it possible to hide unhide the role menu in web with only one link by using command urls?
    Regards,
    M. Erbil

    Hi Memo,
    use something like this:
    <!-- BW data source object tags -->
    <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="SET_PROPERTIES"/>
             <param name="TEMPLATE_ID" value="ROLEMENU"/>
             TEMPLATE PROPERTIES
    </object>
    <HTML>
    <HEAD>
    <TITLE>Rolemenu</TITLE>
          <link href="/sap/bw/Mime/BEx/StyleSheets/BWReports.css" type="text/css" rel="stylesheet"/>
         <script type="text/javascript" >
    /* This function switches the attribute HIDDEN (alternate Tablestyles) for item mytable 
    1. Get actual value for attribute  HIDDEN
    2. Send Commando with new attribute to BW Server  */
            function switch_visibility(mytable) {
             var prop = SAPBWGetItemProp(mytable);
             var visibility='X';
             if (prop != null){
                      for(i=1;i<prop.length;i++){
                                if (prop<i>[0] =="HIDDEN") visibility = prop<i>[1];
                if (visibility =='X')  {
                               visibility=' '
                else
                            visibility = 'X';
                SAPBWOpenURL(SAP_BW_URL_Get() +'&item=' + mytable +'&HIDDEN=' + visibility);            
         -->
         </script>
    </HEAD>
    <BODY>
    <P> <object>
             <param name="OWNER" value="SAP_BW"/>
             <param name="CMD" value="GET_ITEM"/>
             <param name="NAME" value="ROLEMENU_1"/>
             <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_MENU"/>
             <param name="WIDTH" value="335"/>
             <param name="GENERATE_CAPTION" value=""/>
             <param name="TARGET" value=""/>
             <param name="HEIGHT" value="285"/>
             <param name="IFRAME" value="X"/>
             <param name="IFRAME_STYLE" value="X"/>
             <param name="HIERARCHY_COLOR" value=""/>
             <param name="DIFF_ICONS" value=""/>
             ITEM:            ROLEMENU_1
    </object> </P><!&mdash;Include a button in HTML with id mybutton1. By clicking on link the function switch_visibility for item ROLEMENU_1 will be executed &agrave;
    <table class="SAPBEXBtnStdBorder" cellspacing="0" cellpadding="0" border="0"><tr><td>
    <table>
    <tr>
       <td class="SAPBEXBtnStd"   id="mybutton1" > <A href="javascript:switch_visibility('ROLEMENU_1');" >show / hide menu</A> 
       </td>
    </tr>
    </table> 
    </td>
    </tr></TABLE><!&mdash;  call function set_button, to set the correct style class for button  mybutton1 &agrave;
    <script type="text/javascript" >
    <!--
          set_button('ROLEMENU_1', 'mybutton1');
    --></SCRIPT>
    </BODY>
    </HTML>
    Regards,
    Adem

  • Hide/Unhide Email Account

    I think there are many times in one's life where it would be great to be able to hide/unhide an email account (without actually deleting it). For instance, when one is on vacation and doesn't want to be "in touch" with what is going on at work via your mobile device which we often use for both work and personal purposes. It would be great if this feature were available with the next iPhone OS update. I think many people would find it of benefit. Hopefully this will get done!

    ?? You can already do this. In settings, just go into the settings for a particular email account, and turn it off. When you launch the mail app and it updates, any account turned "off" will not show up. To get it back, just go back into it's settings and turn the account back "on" (it's just a slider switch).
    Unless I am completely misunderstanding what you want.

  • Hide/Unhide Iterative Rows

    Hi,
    I have a table with two iterative rows.But they are supposed to be displayed based on some criteria.Is there any way to hide/unhide them?.Tried with
    "this.presence='visible' on Row.form load event.
    Thanks in Advance.

    Hi Niall,
    I was unable to upload the file to workscpace.My form has a table with 3 rows where row2 and row3 are iterative rows with xml like this
    <DATA>
    <Details>
    <Documents>
      <Documentname>Doc1</Documentname>
      <DocumentTitle>Title</DocumentTitle>
      <DocumentType>INDIVIDUAL</DocumentType>
      <DocumentInclude>Y</DocumentInclude>
    </Documents>
      <Documents>
      <Documentname>Doc2</Documentname>
      <DocumentTitle>Title</DocumentTitle>
      <DocumentType>INDIVIDUAL</DocumentType>
      <DocumentInclude>N</DocumentInclude>
    </Documents>
      <Documents>
      <Documentname>Doc3</Documentname>
      <DocumentTitle>Title</DocumentTitle>
      <DocumentType>COMPANY</DocumentType>
      <DocumentInclude>Y</DocumentInclude>
    </Documents>
      <Documents>
      <Documentname>Doc4</Documentname>
      <DocumentTitle>Title</DocumentTitle>
      <DocumentType>COMPANY</DocumentType>
      <DocumentInclude>Y</DocumentInclude>
    </Documents>
       </Details>
      </DATA>
    I wanted to display row2 based on conditions that "Documenttype='INDIVIDUAL' and DocumentInclude='Y'" similarly i wanted to display row3 based on "Documenttype='COMPANY' and DocumentInclude='Y'".
    Regards,
    Anusha

  • Hide/Unhide photo shortcut?

    Is there a Hide/Unhide photo keyboard shorcut? There is none listed on the shortcut list.
    Having a shortcut would seem critical for a good workflow: View your Album/Event full screen and just press next and (if necessary) hide the photo...
    I guess the other alternative would be to add it myself using Keyboard Shortcuts under Keyboard and Mouse in the System preferences.
    [Edit] Nevermind - just found it - Command L [/Edit]

    Hi Hannes,
    Use the menu Edit >> Keyboard Shortcuts to modify/create new shortcut keys for the menu commands in AI.
    Just select the option "Menu Commands" in the drop-down list and modify/create them accordingly.
    With Best Regards,
    Raghuveer

  • Page hide Unhide in acrobat

    Is  it possible to hide/unhide page in acrobat? How can I do?
    Can it work in reader?
    Please help me....

    As it has been said, Acrobat can do it rather easily.
    For Reader, there are some possibilities.
    • You have access to the Reader Extensions Server (or whatever they call it today), and then you can spawn Template pages, and delete them again in Reader.
    • You work with "virtual pages", by making the pages the icons of page-sized Button fields, and provide according navigation tools. Showing/hiding fields works in Reader without the need of any additionsl rights. It may, however, be a little bit unusual for the users.
    HTH.
    Max Wyss.

  • Show and hide Lov icons and Date Picker image on conditional?

    How to show and hide Lov icons and Date Picker image on conditional?

    Why do you just want to make the icons conditional? Shouldn't the field also be conditional?
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

  • Hide/Unhide Columns in WEBI Report output

    We have a WEBI report which has 2 columns/measures to display the cost in EUR and USD. User would like to have the flexibility to filter the column so as to display USD or EUR cost column. Is it possible to hide/unhide column in WEBI. Can we have a input control on multiple measures so that user can dynamically select which measures they want to see on report.
    Its possible in BEx Analyser using filter option on key figure. Is simillar functionality available in WEBI? We're on BO 3.1 XI. Is thre any other way to achieve this?
    Thanks,
    Milind

    hi,
         i think it is not possible to hide a column based on condition. but in webi 4.0 u have an option using which, u can hide/ show a table based on the user selection. in ur scenario, create two tables, one with value in USD and other in EU, super impose the table. then right onthe table and select "Format cell". in that u ll have a option to hide the table based on condition. select that and apply the condition.
    see the follwoing url for more info : http://bihappyblog.com/2011/11/05/dynamic-visibility-in-webi/
    thank u,
    Edited by: aady89 on Mar 9, 2012 7:39 AM

  • How to hide ,unhide columns  in ALV List

    Hi all,
    How to hide ,unhide columns  in ALV List..
    Plz guide me.
    Thanks in advance..
    Albert

    Hi Joseph,
    Check the following thread:
    Hide Unhide columns of ALV grid Report.
    Regards,
    Archana

  • JavaScript - How to collapse/uncollapse (hide/unhide) the top menus in SharePoint 2010?

    Hi there,
    I will appreciate if someone can provide JavaScript that can hie/unhide the top ribbon and navigation menu? (SharePoint 2010)
    Thanks.

    Hi,
    By investigating the page source, we can see that the Ribbon is corresponding to the <div> whose id is “s4-ribbonrow”, the Top Navigation is “zz17_TopNavigationMenuV4”,
    then we can change the style these two elements to hide/unhide them.
    The links below with code demos about
    how to hide/unhide page elements using JavaScript for your reference:
    http://www.w3schools.com/jsref/prop_style_visibility.asp
    http://www.javascriptkit.com/javatutors/dom3.shtml
    http://www.dustindiaz.com/seven-togglers/
    Here is a link about
    how to find a specific element on a page using JavaScript:
    http://javascript.info/tutorial/searching-elements-dom
    Feel free to reply if there still any questions.
    Best regards
    Patrick Liang
    TechNet Community Support

Maybe you are looking for

  • Help needed in getting the previous Quarter Data

    Hello folks, I have this procedure where i have to modify the current procedure in the following manner: I need to get rid of the variables p_start and p_end so that i cannot see them in the crystal report and include the Frequency in the procedure t

  • How do you select what pictures are in your photo stream?

    I don't understand how pictures are included in the photo stream. Have an iphone 4 that I want to set up so all the pictures/videos are available on my mac book??

  • How to get back to default user login from 'switch user' screen

    Hi I have a macbook air and mistakenly pressed 'switch user' from the login screen. Now I am stuck on a different login screen with now option to go back to the main / usual one? Is there a keyboard shortcut or something to go back? The only option I

  • How to Handle Data with Icons

    I'm trying to create a directory of showroom locations and the type of products that they carry. I need an efficient way to manage the data (like an Access database) but I need to represent the product categories with icons. My team has drawn the ico

  • Database Refresh From ASM Filesystem to Local Filesystem

    Hi ALL, I am performing a database refresh from production server to a demo server. Our Production database is 11.2.0.1 and it is using ASM filesystem to keep the data, redo and other files in ASM disks. On the other hand demo server is not having AS