--- loncom/interface/createaccount.pm 2008/07/08 13:57:00 1.11 +++ loncom/interface/createaccount.pm 2008/07/08 17:47:57 1.12 @@ -3,7 +3,7 @@ # institutional log-in ID (institutional authentication required - localauth # or kerberos) or an e-mail address. # -# $Id: createaccount.pm,v 1.11 2008/07/08 13:57:00 raeburn Exp $ +# $Id: createaccount.pm,v 1.12 2008/07/08 17:47:57 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,6 +35,7 @@ use Apache::Constants qw(:common); use Apache::lonacc; use Apache::lonnet; use Apache::loncommon; +use Apache::lonhtmlcommon; use Apache::lonlocal; use Apache::lonauth; use Apache::resetpw; @@ -195,6 +196,9 @@ sub handler { $r->print(<$jsh>); $r->print(&javascript_setforms($now)); } + if (grep(/^email$/,@cancreate)) { + $r->print(&javascript_validmail()); + } $output = &print_username_form($domain,$domdesc,\@cancreate,$now,$lonhost, $courseid); } @@ -277,6 +281,27 @@ ENDSCRIPT return $js; } +sub javascript_validmail { + my %lt = &Apache::lonlocal::texthash ( + email => 'The e-mail address you entered', + notv => 'is not a valid e-mail address', + ); + my $output = "\n".''."\n"; + return $output; +} + sub print_username_form { my ($domain,$domdesc,$cancreate,$now,$lonhost,$courseid) = @_; my %lt = &Apache::lonlocal::texthash( @@ -327,7 +352,7 @@ sub print_username_form { my $emailform = ''; my $captchaform = &create_captcha(); my $submit_text = &mt('Request LON-CAPA account'); - $output .= '
'. + $output .= ''. &Apache::lonhtmlcommon::start_pick_box()."\n". &Apache::lonhtmlcommon::row_title(&mt('E-mail address'), 'LC_pick_box_title')."\n".