Trying to set editor field name to cookie value. Comes up blank..

Trying to set editor field name to cookie value. Comes up blank..

nicoledramirez@hotmail.comnicoledramirez@hotmail.com Posts: 60Questions: 14Answers: 2
      editor.on('initEdit', function getCookie(name) {

            var re = new RegExp(name + "=([^;]+)");
            var value = re.exec(document.cookie);
            return (value != null) ? unescape(value[1]) : null;

    var uname = getCookie("myCookie").replace("UserName=", "")


    editor.field('User').def(uname);

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.