...

View Full Version : Changing user form input



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

www.acistjohn.com/newform

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?

THanx!
Marc

hemebond
11-05-2004, 02:12 AM
Broken link.

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

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

alert(resultDate);


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