Hi,
I wanted to develop a control which is very much similar to the CRM Date/Time Control(I am referring to the control which shows both Date and Time). I have seen the below post and found that to use a Date control of CRM we need to use the class 'DateTimeUI_RenderDateControl_td'
and to use the Time control we need to use 'DateTimeUI_RenderTimeControl_td2'.
http://social.microsoft.com/Forums/en-US/33c577fb-0dd8-444c-ac3b-5667256c5158/hidding-date-on-datatime-field?forum=crmdevelopment
The issue is, when I refer the class related to Time, it does not work fine, but where as the reference to Date works just fine.
Below is the code i have written.
var table = document.createElement("table");
table.width = "100%";
table.className = "ms-crm-DateTime";
table.style.tableLayout = "fixed";
table.cellPadding = 0;
table.cellSpacing = 0;
var row1 = table.insertRow();
var row1cell1 = row1.insertCell();
row1cell1.className = "DateTimeUI_RenderDateControl_td";
var input = document.createElement("input");
row1cell1.appendChild(input);
input.type = "text";
input.maxLength = 200;
input.className = "ms-crm-Text";
var tabindex = Field.index + 2;
if (tabindex > 9) input.tabIndex = "2" + tabindex.toString() + "0";
else input.tabIndex = "20" + tabindex.toString() + "0";
//cell.appendChild(table);
Field.input = input;
var row1cell2 = row1.insertCell();
var img = document.createElement("img");
row1cell2.appendChild(img);
row1cell2.style.width = "36";
img.className = "ms-crm-DateTime ms-crm-ImageStrip-btn_off_cal";
img.src = "/_imgs/imagestrips/transparent_spacer.gif?ver=1090125681";
//Time
var row1cell3 = row1.insertCell();
row1cell3.className = "DateTimeUI_RenderTimeControl_td2";
var input1 = document.createElement("input");
row1cell3.appendChild(input1);
input1.type = "text";
input1.maxLength = 50;
input1.className = "ms-crm-Text";
// var tabindex1 = Field.index + 2;
// if (tabindex1 > 9) input1.tabIndex1 = "2" + tabindex1.toString() + "0";
// else input1.tabIndex1 = "20" + tabindex1.toString() + "0";
cell.appendChild(table);
Field.input = input1;
//Field.setShowTime(true);
var row1cell4 = row1.insertCell();
var img1 = document.createElement("img");
row1cell4.appendChild(img1);
row1cell4.style.width = "36";
//select_htc_img_selectOff
img1.className = "ms-crm-SelectBox ms-crm-Select-Input-Container ms-crm-ImageStrip-btn_off_cal";
img1.src = "/_imgs/imagestrips/transparent_spacer.gif?ver=1090125681";
if (Field.onChange != null) input.onchange = function(){fieldOnChange(Field.index);};
Any help is appreciated!
-Chandrahas