Click here to Skip to main content
15,880,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi in my aspx page m using javascript calender control.when i run page and go to select dropdowns tat time calender control disabled.means i cant see calender control.can any one solve my problem..


XML
<link rel="stylesheet" type="text/css" href="../Calender/1-simple-calendar/tcal.css" />

   <script type="text/javascript" src="../Calender/1-simple-calendar/tcal.js"></script>



and here is my textbox control.

XML
<tr>
                <td>
                    Star Date:
                </td>
                <td>
                    <asp:TextBox ID="txtSDate" runat="server" ReadOnly="true" AutoPostBack="True"
                        class="tcal"></asp:TextBox>
                </td>
            </tr>



can any one solve my problem..thanks in advance..
Posted

1 solution

check your javascript reference path or you need to Set the "txtSDate" to your tcal.js code or post tcal.js code for me to read and analyze

vote and accept solution
If this will help you
thanks
 
Share this answer
 
v2
Comments
ythisbug 22-Feb-12 23:22pm    
var A_TCALCONF = {
'cssprefix' : 'tcal',
'months' : ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
'longwdays' : ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
'yearscroll' : true, // show year scroller
'weekstart' : 0, // first day of week: 0-Su or 1-Mo
'prevyear' : 'Previous Year',
'nextyear' : 'Next Year',
'prevmonth' : 'Previous Month',
'nextmonth' : 'Next Month',
'format' : 'm/d/Y' // 'd-m-Y', Y-m-d', 'l, F jS Y'
};

var A_TCALTOKENS = [
// A full numeric representation of a year, 4 digits
{'t': 'Y', 'r': '19\\d{2}|20\\d{2}', 'p': function (d_date, n_value) { d_date.setFullYear(Number(n_value)); return d_date; }, 'g': function (d_date) { var n_year = d_date.getFullYear(); return n_year; }},
// Numeric representation of a month, with leading zeros
{'t': 'm', 'r': '0?[1-9]|1[0-2]', 'p': function (d_date, n_value) { d_date.setMonth(Number(n_value) - 1); return d_date; }, 'g': function (d_date) { var n_month = d_date.getMonth() + 1; return (n_month < 10 ? '0' : '') + n_month }},
// A full textual representation of a month, such as January or March
{'t': 'F', 'r': A_TCALCONF.months.join('|'), 'p': function (d_date, s_value) { for (var m = 0; m < 12; m++) if (A_TCALCONF.months[m] == s_value) { d_date.setMonth(m); return d_date; }}, 'g': function (d_date) { return A_TCALCONF.months[d_date.getMonth()]; }},
// Day of the month, 2 digits with leading zeros
{'t': 'd', 'r': '0?[1-9]|[12][0-9]|3[01]', 'p': function (d_date, n_value) { d_date.setDate(Number(n_value)); if (d_date.getDate() != n_value) d_date.setDate(0); return d_date }, 'g': function (d_date) { var n_date = d_date.getDate(); return (n_date < 10 ? '0' : '') + n_date; }},
// Day of the month without leading zeros
{'t': 'j', 'r': '0?[1-9]|[12][0-9]|3[01]', 'p': function (d_date, n_value) { d_date.setDate(Number(n_value)); if (d_date.getDate() != n_value) d_date.setDate(0); return d_date }, 'g': function (d_date) { var n_date = d_date.getDate(); return n_date; }},
// A full textual representation of the day of the week
{'t': 'l', 'r': A_TCALCONF.longwdays.join('|'), 'p': function (d_date, s_value) { return d_date }, 'g': function (d_date) { return A_TCALCONF.longwdays[d_date.getDay()]; }},
// English ordinal suffix for the day of the month, 2 characters
{'t': 'S', 'r': 'st|nd|rd|th', 'p': function (d_date, s_value) { return d_date }, 'g': function (d_date) { n_date = d_date.getDate(); if (n_date % 10 == 1 && n_date != 11) return 'st'; if (n_date % 10 == 2 && n_date != 12) return 'nd'; if (n_date % 10 == 3 && n_date != 13) return 'rd'; return 'th'; }}

];


function f_tcalGetHTML (d_date) {

var e_input = f_tcalGetInputs(true);
if (!e_input) return;

var s_pfx = A_TCALCONF.cssprefix,
s_format = A_TCALCONF.format;

// today from config or client date
var d_today = f_tcalParseDate(A_TCALCONF.today, A_TCALCONF.format);
if (!d_today)
d_today = f_tcalResetTime(new Date());

// selected date from input or config or today
var d_selected = f_tcalParseDate(e_input.value, s_format);
if (!d_selected)
d_selected = f_tcalParseDate(A_TCALCONF.selected, A_TCALCONF.format);
if (!d_selected)
d_selected = new Date(d_today);

// show calendar for passed or selected date
d_date = d_date ? f_tcalResetTime(d_date) : new Date(d_selected);

var d_firstDay = new Date(d_date);
d_firstDay.setDate(1);
d_firstDay.setDate(1 - (7 + d_firstDay.getDay() - A_TCALCONF.weekstart) % 7);

var a_class, s_html = '<table id="' + s_pfx + 'Controls"><tbody><tr>'
+ (A_TCALCONF.yearscroll ? '<td id="' + s_pfx + 'PrevYear" ' + f_tcalRelDate(d_date, -1, 'y') + ' title="' + A_TCALCONF.prevyear + '"></td>' : '')
+ '<td id="' + s_pfx + 'PrevMonth"' + f_tcalRelDate(d_date, -1) + ' title="' + A_TCALCONF.prevmonth + '"></td><th>'
+ A_TCALCONF.months[d_date.ge
ythisbug 22-Feb-12 23:37pm    
function f_tcalGetInputs (b_active) {

var a_inputs = document.getElementsByTagName('input'),
e_input, s_rel, a_result = [];

for (n = 0; n < a_inputs.length; n++) {

e_input = a_inputs[n];
if (!e_input.type || e_input.type != 'text')
continue;

if (!f_tcalHasClass(e_input, 'tcal'))
continue;

if (b_active && f_tcalHasClass(e_input, A_TCALCONF.cssprefix + 'Active'))
return e_input;

a_result[a_result.length] = e_input;
}
return b_active ? null : a_result;
}
ythisbug 22-Feb-12 23:29pm    
<form action="#">
<!-- add class="tcal" to your input field -->
<div><input type="text" name="date" class="tcal" value="" /></div>
</form>

they used like this but i want to use this to my texbox feild.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900