How i can chage the date formatt using java script?


hi all,

 

i have data field. in object -> valid patterns changed format mm/dd/yyyy.

 

and writing java script code on exit event of date field

 

 

var

 

regooddate = /^(?:(0[1-9]|1[012])[\/.](0[1-9]|[12][0-9]|3[01])[\/.](19|20)[0-9]{2})$/

;

 

if (regooddate.test(dt))

{

xfa.host.messagebox("correct format")

}

else

{

xfa.host.messagebox("incorrect format");

}

 

 

but though giving correct date formatt giving  error message

hi,

 

try these regular expression instead.

 

if (this.formattedvalue.match(/^(0[1-9]|1[012])[-\/\.](0[1-9]|[12][0-9]|3[01])[-\/\.]((19|20)\d{2}|\d{2})$/g)) {           xfa.host.messagebox("correct date"); } else {           xfa.host.messagebox("wrong date"); } 


More discussions in LiveCycle Designer


adobe

Comments

Popular posts from this blog

Adobe Acrobat Pro , Terminal Server Use

Thread: transmission-daemon isn't playing nice: "409: Conflict"

Thread: gpg: Conflicting Commands