Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Input Field Color [SOLVED]
ScotDiddle
Member

Posts: 24
Registered: 11/28/2007
Location: Richmond, VA
Member Is Offline
posted on 3/27/2008 at 12:41 PM Reply With Quote
Input Field Color [SOLVED]


Good Morning, All,

Suppose I have several calendars displayed for my user... They select their dates, then submit the form...

Of calendars A, B, C, D, and E, all have valid dates ( from my applications perspective ), except D, which has an invalid date.

Upon re-presenting the page to my user, how do I highlight the input date field for Calendar D to appear in RED, to make it easier for my user to find which calendar date needs correcting.

Thanks,

Scot L. Diddle, Richmond VA
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 3/27/2008 at 03:07 PM Reply With Quote

With the PRO version of the script you can attach the calendar to the existing static HTML input box.
You can then generate the style attributes with the server side script.
View User's Profile View All Posts By User U2U Member
ScotDiddle
Member

Posts: 24
Registered: 11/28/2007
Location: Richmond, VA
Member Is Offline
posted on 3/27/2008 at 07:00 PM Reply With Quote

Thanks,

I read in your doc that I could contol color, but how do I id the name of the input box... When I "view source " of my HTML, all's I see is "new calendar(cal_name, Tpl_name)"

Any Suggestions ?

Thanks, Scot
View User's Profile View All Posts By User U2U Member
ScotDiddle
Member

Posts: 24
Registered: 11/28/2007
Location: Richmond, VA
Member Is Offline
posted on 6/18/2008 at 06:50 PM Reply With Quote
Input Field Color


Hello All You Tigra Calendar Enthusiasts !

Well... Had to answer my own question...

It turns out that the HTML 'id=' of the input fields are generated via the javascript var: 'this.TC07' in the calendar.js file function: 'function calendar(TCL,TCK) { ' (in the " document.write('<input type="Text" ...') " statement... ). 'this.TC07' is the vlaue of the 'controlname': parm you specify when defining your calendar... Vis.:

Code:

var CAL_INIT1 = {
'controlname': 'MY_CALENDAR_NAME',
'formname': 'test_form',
'dataformat': 'd.m.Y H:i',
'replace': true
};


Here, the HTML name 'id=' name of the calendar's input box is : 'MY_CALENDAR_NAME'.

I am not sure about the other modes of calendar generation, ( like pop-up, et-all), since I use modal_mode exclusively, but if you fail, or choose not to, include a 'controlname' parm, you get: id='datetime_0', id='datetime_1' (etc.) ... , one for each calendar defined on your page via:

Code:

for (var n = 0; n < A_CALENDARS.length; n++) {
A_CALENDARS[n].create();
}


Now that that is clear (as mud) you just have to have a CSS Style sheet with entries like;

Code:

#MY_CALENDAR_NAME {
color: #205E75;
font-family: Verdana, Tahoma;
font-size: 11px;
padding-left: 5px;
padding-right: 5px;
}

... ( one for each name calendar)

/* or */

#datetime_0 { /* _0, _1, _2, ...etc : one for each calendar */
color: #205E75;
font-family: Verdana, Tahoma;
font-size: 11px;
padding-left: 5px;
padding-right: 5px;
}


Now, if I could just figure out how to close a calendar programmatically, I would be a happy camper.

Scot L. Diddle, Richmond VA
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 6/19/2008 at 06:30 AM Reply With Quote

you can use .showcal() method for that.

i.e.

A_CALENDARS[0].showcal();
View User's Profile View All Posts By User U2U Member
ScotDiddle
Member

Posts: 24
Registered: 11/28/2007
Location: Richmond, VA
Member Is Offline
posted on 6/19/2008 at 11:01 AM Reply With Quote

Tigra Admin...

Thanks. That almost works... What I need to accomplish is that when a user opens a calendar, then decides to select a hidden div to display some date-range calendars, and they fail to close the single date calendar, I need to close if for them.

Adding your code in a function called via "onChange=" parm in my "switch div" select, if the cal is open, it closes it, but if it is closed, it opens it...

Is there some way to determine the name of the calendar(s) which is/are currently open, so I can do:

[pseudo-code]

if system finds that the punkin' user left cal[n] open while onChange is happening {

Do the "close option" of A_CALENDARS[n].showcal();

}

[/pseudo-code]

Thanks,

Scot L. Diddle, Richmond VA
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 6/19/2008 at 01:07 PM Reply With Quote

property TC3b is the state indicator i.e.

if (A_CALENDARS[n].TC3b)
...
View User's Profile View All Posts By User U2U Member
ScotDiddle
Member

Posts: 24
Registered: 11/28/2007
Location: Richmond, VA
Member Is Offline
posted on 6/19/2008 at 05:52 PM Reply With Quote

Tigra Admin,

Thanks for the input... I posted my solution here: http://www.softcomplex.com/forum/viewthread_4716/

Any idea how to revert the 'click me to close' icon without having to call .showcal() twice ?

If you have any ideas, please post under the new thread.

Thanks,

Scot L. Diddle, Happy Camper.
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 6/20/2008 at 05:50 AM Reply With Quote

the calendar swaps the icon like this:

this.TC0x.src=this.TCK.caliconhide.src;
this.TC0x.src=this.TCK.caliconshow.src;

when done from outside of the calendar replace 'this' with 'A_CALENDARS[n]'
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Popup Calendar
Onpage Calendar
Modal Calendar
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004