Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2004
    Location
    N'awlins Louisiana
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Changing user form input

    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

  • #2
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Broken link.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    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.
    Check out the Forum Search. It's the short path to getting great results from this forum.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •