--- loncom/interface/loncreateuser.pm	2007/12/14 17:35:52	1.210
+++ loncom/interface/loncreateuser.pm	2007/12/14 21:27:07	1.211
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Create a user
 #
-# $Id: loncreateuser.pm,v 1.210 2007/12/14 17:35:52 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.211 2007/12/14 21:27:07 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -295,7 +295,7 @@ $userpicker
 <input name="userrole" type="button" value="$srchbutton" onclick="javascript:validateEntry(document.crtuser)" />
 </form>
 ENDBLOCK
-    if ($cancreate) {
+    if ($cancreate && $env{'form.phase'} eq '') {
         my $defdom=$env{'request.role.domain'};
         my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain');
         my $helpcrt=&Apache::loncommon::help_open_topic('Course_Change_Privileges');
@@ -3355,8 +3355,18 @@ sub crumb_utilities {
 
     my $jsback .= qq|
 function backPage(formname,prevphase,prevstate) {
-    formname.phase.value = prevphase;
-    formname.currstate.value = prevstate;
+    if (typeof prevphase == 'undefined') {
+        formname.phase.value = '';
+    }
+    else {  
+        formname.phase.value = prevphase;
+    }
+    if (typeof prevstate == 'undefined') {
+        formname.currstate.value = '';
+    }
+    else {
+        formname.currstate.value = prevstate;
+    }
     formname.submit();
 }
 |;