/    Sign up×
Community /Pin to ProfileBookmark

Format the date

<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?

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@GollumJun 20.2003 — 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.
Copy linkTweet thisAlerts:
@Khalid_AliJun 20.2003 — 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
×

Success!

Help @Gopinath spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...