added a method to return javascript to select form element with first error for use...
[moodle.git] / login / signup_form.html
1 <?php
2    if (empty($user->username)) {
3        $user->username = "";
4    }
5    if (empty($user->password)) {
6        $user->password = "";
7    }
8    if (empty($user->email)) {
9        $user->email = "";
10    }
11    if (empty($user->email2)) {
12        $user->email2 = "";
13    }
14    if (empty($user->firstname)) {
15        $user->firstname = "";
16    }
17    if (empty($user->lastname)) {
18        $user->lastname = "";
19    }
20    if (empty($user->city)) {
21        $user->city = "";
22    }
23    if (empty($user->country)) {
24        $user->country = "";
25    }
26 ?>
27 <table cellpadding="20" align="center"> <tr> <td class="generalbox">
28 <form action="signup.php" method="post" name="form" id="form">
29 <table>
30 <tr valign="top">
31     <td colspan="2"><b><?php print_string("createuserandpass") ?>:</b></td>
32 </tr>
33 <tr valign="top">
34     <td align="right"><?php print_string("username") ?>:</td>
35     <td><input type="text" name="username" size="12" value="<?php p($user->username) ?>" alt="<?php print_string("username") ?>" />
36     <?php if (!empty($err->username)) { formerr($err->username); } ?>
37     </td>
38 </tr>
39 <tr valign="top">
40     <td align="right"><?php print_string("password") ?>:</td>
41     <td><input type="password" name="password" size="12" value="<?php p($user->password) ?>" alt="<?php print_string("password") ?>" />
42     <?php if (!empty($err->password)) { formerr($err->password); } ?>
43     </td>
44 </tr>
45 <tr valign="top">
46     <td colspan="2"><p><br />
47                   <b><?php print_string("supplyinfo") ?>:</b><br />
48                   (<?php print_string("emailmustbereal") ?>)</p>
49               </td>
50             </tr>
51 <tr valign="top">
52     <td align="right"><?php print_string("email") ?>:</td>
53     <td><input type="text" name="email" size="25" value="<?php p($user->email) ?>" alt="<?php print_string("email") ?>" />
54     <?php if (!empty($err->email)) { formerr($err->email); } ?>
55     </td>
56 </tr>
57 <tr valign="top">
58     <td align="right"><?php print_string("emailagain") ?>:</td>
59     <td><input type="text" name="email2" size="25" value="<?php p($user->email2) ?>" alt="<?php print_string("emailagain") ?>" />
60     <?php if (!empty($err->email2)) { formerr($err->email2); } ?>
61     </td>
62 </tr>
63 <tr valign="top">
64     <td align="right"><?php print_string("firstname") ?>:</td>
65     <td><input type="text" name="firstname" size="25" value="<?php p($user->firstname) ?>" alt="<?php print_string("firstname") ?>" />
66     <?php if (!empty($err->firstname)) { formerr($err->firstname);} ?>
67     </td>
68 </tr>
69 <tr valign="top">
70     <td align="right"><?php print_string("lastname") ?>:</td>
71     <td><input type="text" name="lastname" size="25" value="<?php p($user->lastname) ?>" alt="<?php print_string("lastname") ?>" />
72     <?php if (!empty($err->lastname)) { formerr($err->lastname);} ?>
73     </td>
74 </tr>
75 <tr valign="top">
76     <td align="right"><?php print_string("city") ?>:</td>
77     <td><input type="text" name="city" size="25" value="<?php p($user->city) ?>" alt="<?php print_string("city") ?>" />
78     <?php if (!empty($err->city)) { formerr($err->city);} ?>
79     </td>
80 </tr>
81 <tr valign="top">
82     <td align="right"><?php print_string("country") ?>:</td>
83     <td><?php choose_from_menu (get_list_of_countries(), "country", $user->country, get_string("selectacountry"), "", "") ?>
84     <?php if (!empty($err->country)) { formerr($err->country);} ?>
85     </td>
86 </tr>
87 <tr>
88     <td></td>
89     <td><input type="submit" value="<?php print_string("createaccount") ?>" /></td>
90 </tr>
91 </table>
92 </form>
93 </td></tr></table>