A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Losing comma's

Threaded View

  1. #1
    Senior Member
    Join Date
    Sep 2002
    Location
    Clogland
    Posts
    100

    Losing comma's

    I'm trying to get details from athree FComboBoxes named "year", "month" and "day" and then insert the details into a MySql database in the "YYYYMMDD" format.

    The method I use below gets me an output of "YYYY,MM,DD".

    All I need to do is get rid of the comma's, but the "Strip" command as suggested by other threads here doesn't seem to work.

    I think I must be either missing a basic principle here, or have missed an easier way to go about it.

    TIA

    Code:
    dayValue=period.day.getValue();             //   Extracting values 
    monthValue=period.maand.getValue();         //   from drop down
    yearValue=period.jaar.getValue();           //   FComboBoxes
    
    //adding "0's" for entry into Mysql Database
    if(dayValue<10){
    	dayValue = "0" + dayValue;
    }
    if(monthValue<10){
    	monthValue = "0" + monthValue;
    }
    
    periodDate=[yearValue,monthValue,dayValue];  //   Making array
    
    NewPeriodDate = periodDate.split(",").join("");   // Doesn't work:confused:
    
    trace(periodDate);   	// returns YYYY-MM-DD
    trace(NewPeriodDate);   // returns "undefined"
    Last edited by skalie; 08-14-2003 at 05:12 AM.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center