View Full Version : Changing user form input

11-04-2004, 10:14 PM
i have a form out ther that i am working with ....


on the form you will see field H which displays the format that the user inputs the data (MM/DD/YYYY) on one of the other fields (the PERIOD ENDED: field on the bottom part) i want to take that input, copy it there and change the format so it displays as such YYYY-MM can this be accomplished using javascript?


11-05-2004, 01:12 AM
Broken link.

Roy Sinclair
11-05-2004, 03:28 PM
var inputDateFromForm = "MM/DD/YYYY";
var resultDate;

resultDate = inputDateFromForm.substr(6,4) + "-" + inputDateFromForm.substr(0,2);


Run this snippet of code and you'll see that it performs the conversion you want.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum