Results 1 to 2 of 2

Thread: Format

  1. #1
    Sid Guest

    Default Format

    using Javascript assigned date to a variabel like below.<BR><BR>var eDate = btnObj.form.EndYear.value;<BR><BR>Now the eDate&#039;s value is &#039;2001&#039;. Can some one tell me how can I change this to &#039;01&#039;?<BR><BR>Thanks<BR>Sid

  2. #2
    Join Date
    Dec 1969

    Default Not really format...

    ...just a string, so chop it as you wish!<BR><BR>if ( eDate.length == 4 ) eDate = eDate.substring(2);<BR><BR>Remember, all of the .value things you get from form fields are *always* strings. Even if they *look* like numbers, they are actually strings. So you can use any string manipulation on them you wish to.<BR><BR><BR><BR>

Posting Permissions

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