I have a form that people fill out, that goes to a google spreadsheet. When this happens, I am trying to automatically change the color of the new row from the form based upon the date in one of the columns. I have found questions similar to this, and I was able to generate this code from those questions, but when the code runs, it does not change the background color. What am I doing wrong?
function onEdit(e) {
if (e) { 
    var ss = e.source.getActiveSheet();
    var r = e.source.getActiveRange(); 
    if (ss.getName() == "Form Responses Sorted") {
        // E.g. date column is 5th (E)
        date = ss.getRange(r.getRow(),5).getValue();
        rowRange = ss.getRange(r.getRow(),1,1,20);
        // This changes background color
        if (date == '8/5/2013') {
            rowRange.setBackgroundColor("#D00000");
        } else if (date == '8/12/2013') {
            rowRange.setBackgroundColor("#A0A0A0");
        } else if (date == '9/9/2013') { 
            rowRange.setBackgroundColor("#00FF00");
        } else if (date == '9/23/2013') {
            rowRange.setFontColor("#33FFCC");
        } else if (date == '9/30/2013') { 
            rowRange.setFontColor("#CCFF33");
        } else if (date == '10/7/2013') {
            rowRange.setFontColor("#FF6699");
        } else if (date == '10/21/2013') { 
            rowRange.setFontColor("#CC66CC");
        } else if (date == '11/4/2013') {
            rowRange.setFontColor("#6666FF");
        } else if (date == '11/25/2013') { 
            rowRange.setFontColor("#9933FF");
        } else if (date == '12/9/2013') {
            rowRange.setFontColor("#FF9933");
        } else if (date == '12/16/2013') { 
            rowRange.setFontColor("#FFFFFF");
        } else if (date == '1/13/2014') {
            rowRange.setFontColor("#CC9933");
        }
    }
}
}
 
     
    