I have a custom register function:
def myregister():
response.view = 'default/myregister.html'
form = auth.register()
if form.validate():
# my custom code
elif form.errors:
get_flash(response, None, 'danger', 'error')
elif not response.flash:
get_flash(response, None, 'info', 'default')
return dict(form=form)
In the myregister view a have the following code:
<div id="web2py_user_form" class="form">
<form class="form-custom" action="#" enctype="multipart/form-data"
method="post" role="form">
<fieldset>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
{{=form.custom.widget.title}}
</div> <!-- /.form-group -->
<div class="row">
<div class="col-sm-6">
<div class="form-group">
{{=form.custom.widget.first_name}}
</div> <!-- /.form-group -->
</div> <!-- /.col-sm-6 -->
<div class="col-sm-6">
<div class="form-group">
{{=form.custom.widget.familyNamePreposition}}
</div> <!-- /.form-group -->
</div> <!-- /.col-sm-6 -->
</div> <!-- /.row -->
<div class="form-group">
{{=form.custom.widget.last_name}}
</div> <!-- /.form-group -->
<div class="row">
<div class="col-sm-6">
<div class="form-group">
{{=form.custom.widget.email}}
</div> <!-- /.form-group -->
</div> <!-- /.col-sm-6 -->
<div class="col-sm-6">
{{=form.custom.widget.username}}
</div> <!-- /.col-sm-6 -->
</div> <!-- /.row -->
<div class="row">
<div class="col-sm-6">
<div class="form-group">
{{=form.custom.widget.password}}
</div> <!-- /.form-group -->
</div> <!-- /.col-sm-6 -->
<div class="col-sm-6">
<div class="form-group">
{{=form.custom.widget.password_two}}
</div> <!-- /.form-group -->
</div> <!-- /.col-sm-6 -->
</div> <!-- /.row -->
</div> <!-- /.col-sm-6 -->
<div class="col-sm-6">
</div> <!-- /.col-sm-6 -->
</div> <!-- /.row -->
<div class="row">
<div class="col-sm-6"></div> <!-- /.col-sm-6 -->
<div class="col-sm-6">
<div class="pull-right">
<div class="form-group">
{{=form.custom.submit}}
{{=INPUT(_class="btn btn-default", _type="button",
_value="Cancel",
_onclick="javascript:history.go(-1);")}}
</div> <!-- /.form-group -->
{{=form.custom.end}}
</div> <!-- /.pull-right -->
</div> <!-- /.col-sm-6 -->
</div> <!-- /.row -->
</fieldset>
</div> <!-- /.form -->
The problem is that when I submit the form it is not being validated.
When I replace the custom form with:
{=form}}
and submit the form it is being validated.
Why doesn't the custom form submit?
Kind regards,
Annet
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.