From 994759d66034f763c168fda36a82eb6b8af85891 Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 14 Jul 2010 18:09:19 +0000 Subject: [PATCH] keep username and email synced if the checkbox is checked. --- user_account.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/user_account.php b/user_account.php index 38cea4f..cf407ae 100644 --- a/user_account.php +++ b/user_account.php @@ -224,7 +224,16 @@ $().ready(function() { $("#username").attr("disabled", username_link); $("#username_link").click(function() { $("#username").attr("disabled", this.checked); + username_link_change(); }); + + function username_link_change() { + if($("#username_link").is(":checked")) { + $("#username").val($('#email').val()); + } + } + $("#email").change(username_link_change); + $("#email").keyup(username_link_change); });