summaryrefslogtreecommitdiff
path: root/newuser.html
blob: f6cf6226e3adfc8a7cee4afb4e8758fd63170c7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<html>
  <head>
    <title>Create a Piny user</title>
    <script src="/js/jquery/jquery.min.js"></script>
    <script type="text/javascript">

      $(document).ready(function(){

        $("#pass2-row").show();

        $("#username").change(function(){

          $.post( "https://secure.dev.piny.be/piny-validate", { t: "Username", v: $("#username").val() }, function( res, stat, req ){
            alert( "res = " + res + "\nstat = " + stat + "\nreq = " + req + "\nreq.responseText = " + req.responseText );
            if ( res ) {
              if ( res.ok ) {
                $("#username-error").removeClass( "error" ).html( "" );
              } else {
                $("#username-error").addClass( "error" ).html( res.msg );
              };
            } else {
              $("#username-error").addClass( "error" ).html( "somehow res is null!" );
            };
          } );

        });

      });

    </script>
  </head>
  <body>
    <h1>Create a Piny user</h1>
    <form action="https://secure.dev.piny.be/piny-newuser" method="POST">
      <div class="field"><div class="label">Desired username</div><div class="input"><input type="text" name="n" id="username" /></div><div id="username-error"></div></div>
      <div class="field"><div class="label">Your email address</div><div class="input"><input type="text" name="a" id="email" /></div><div id="email-error"></div></div>
      <div class="field"><div class="label">Desired password</div><div class="input"><input type="password" name="p" id="pass1" /></div><div id="pass1-error"></div></div>
      <div class="field" id="pass2-row" style="display: none"><div class="label">Retype password</div><div class="input"><input type="password" id="pass2" /></div><div id="pass2-error"></div></div>
      <div class="field"><div class="label"></div><div class="input"><input type="submit" name="Create User" /></div></div>
    </form>
  </body>
</html>