Hello Massimo,  First thanks for you help... I'm stil not successful
with customizing the form for Auth Api using Ajax. Please let me know
what I'm doing wrong... Here is my view and controller (I did not
extend Layout.html)

#############
# Register.html
##############
<html>
<script>
 $('#regForm').submit(function(){
    url = "{{=URL(r=request, f='register')}}";
    ids = [ 'auth_user_fullname', 'auth_user_email',
'auth_user_password', 'auth_user_password_2' ];
         ajax(url, ids , 'registerMsg');
 });

// I took this from Web2py_ajax just for testing this Register
function ajax(u,s,t) {
  var query="";
  for(i=0; i<s.length; i++) {
     if(i>0) query=query+"&";
     query=query+encodeURIComponent(s[i])
+"="+encodeURIComponent(document.getElementById(s[i]).value);
  }
  jQuery.ajax({type: "POST", url: u, data: query, success:
function(msg) { if(t==':eval') eval(msg); else
document.getElementById(t).innerHTML=msg; } });
}
</script>


<div id="registerMsg"> </div>
<div>
<form action="" id="regForm" enctype="multipart/form-data"
method="post">
 Full Name: <input class="string" id="auth_user_fullname"
name="fullname" type="text" value="" />
 Email: <input class="string" id="auth_user_email" name="email"
type="text" value="" />
 Password:  <input class="password" id="auth_user_password"
name="password" type="password" value="" />
 Verify Pwd: <input name="password_two" id="auth_user_password_2"
type="password" />
 <input type="submit" value="Submit" />
</form>
</div>

</html>

##############
# Controller
##############

def register():
    auth.settings.table_user.last_name.writable=False
    auth.settings.table_user.last_name.readable=False

    next = URL(r=request,f='index')
    return auth.register(onaccept=lambda form:
(updateInfo(form),response.headers.update({'web2py-component-
command':"document.location='%s'"%next})))


#########################

When doing this my view has no control on the display, it's like the
form return from the register Action overwritte everything... Can you
please let me know when I'm wrong here...
Thanks,
Yannick P.

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to