Click to See Complete Forum and Search --> : Format the date


Gopinath
06-20-2003, 01:57 AM
<input type=checkbox id=chk_stat_"+int_count+"
onclick=chk_change(int_count,assi_colo_code_id,ass_coll_date)">

int_count is a variable
i have on check box and name it chk_stat_"+int_count
on clicking the check box, invoking a function called chk_change
assi_colo_code_id may 1,4,7
assi_coll_date is the date value('mm/dd/yyyy')

In the called function
function chk_change(int_count, assi_colo_code_id, assi_coll_date)
{
alert(assi_coll_date)
}

the alert msg returns decimal value like
0.00022435564545

very urgent:confused:

Gollum
06-20-2003, 02:13 AM
Are you sure assi_coll_date is a date type?

if you run alert(new Date()); you get something like
Fri Jun 20 08:07:58 UTC+0100 2003

Date objects have many string functions, e.g. toDateString(), toGMTString(), toLocaleDateString(), toLocaleTimeString(), toString(), toTimeString(), toUTCString() all with subtle differences. Or you can get the year,month,day, etc and build your own string.

Khalid Ali
06-20-2003, 02:14 AM
from the looks of it..this part of the code either has less or extra qoutes...

id=chk_stat_"+int_count+"

SInce I am not sure what is your logic..so can't really tell