<snip> if (action == 'update) { quotename.appendChild(quote); return false; // cancels some things further down the page } </snip> Initially, it looks like you are missing a single quote after update: if (action == 'update') mj