First submit button on login page works like a charm.
But submit button on registration page - doesn't.
Content of my user.html
---------------------------------------------------------------------------
{{extend 'layout.html'}}
{{lbl=form.custom.label}}
{{wdgt=form.custom.widget}}
{{if request.args(0)=='login':}}{{#=auth.login()}}
{{=form.custom.begin}}
<table>
<tr>{{=lbl.username}}:<td>{{=wdgt.username}}</td></tr>
<tr>{{=lbl.password}}:<td>{{=wdgt.password}}</td></tr>
</table>
{{=form.custom.submit}}
{{=form.custom.end}}
{{elif request.args(0)=='register':}}
{{=form.custom.begin}}
<table>
<tr>
<label for="register_login">{{=lbl.username}}</label>
<td><input type="text" id="username" name="username"
onblur="getData(this.value)" /></td>
<td><div id="resultbox" class="msg"></div></td>
<tr>
<label for="password"
id="auth_user_password">{{=lbl.password}}</label>
<td>{{=wdgt.password}}<td>
</tr>
<tr>
<label for="register_first_name" >{{=lbl.first_name}}</
label>
<td>{{=wdgt.first_name}}</td>
</tr>
<tr>
<label for="register_last_name" >{{=lbl.last_name}}</
label>
<td>{{=wdgt.last_name}}</td>
</tr>
<tr>
<label for="register_email" >{{=lbl.email}}</label>
<td>{{=wdgt.email}}</td>
</tr>
<tr>
<label for="register_phone" >{{=lbl.phone_no}}</label></
th>
<td>{{=wdgt.phone_no1}}</td>
</tr>
<table>
{{=form.custom.submit}}
{{=form.custom.end}}
{{pass}}
additionaly layout.html incluedes also this:
---------------------------------------------------------------------------------------------------------
<script type="text/javascript"
src="{{=URL(r=request,c='static',f='jquery.js')}}"></script>
<script type="text/javascript">
var submit = false;
$(document).ready(function(){
$("form").submit(function() {
return submit;
});
});
function getData(value){
if(value != ""){
$
("#resultbox").removeClass().addClass('msg').text('Validating...').fadeIn(100);
$.post("{{=URL(r=request,c='default',f='ajaxuserexist')}}",
{username:value},function(result){
if(result=='yes'){
$
("#resultbox").removeClass().addClass('error').text('Username already
taken').fadeTo(900,1);
submit = false;
}else{
$
("#resultbox").removeClass().addClass('success').text('Username is
available for registration!').fadeTo(900,1);
submit = true;
}
});
}else{
$("#resultbox").removeClass().addClass('msg').text('This
field is required');
}
}
</script>
This is used for on the fly username checking in the DB.
On 23 Lip, 15:14, mdipierro <[email protected]> wrote:
> Please show us the form and the customization. {{=form.custom.submit}}
> should just produce <input type="submit"/>. The problem is somewhere
> else.
>
> On Jul 22, 6:37 pm, elfuego1 <[email protected]> wrote:
>
>
>
> > Hi,
>
> > I had made my custom form, but adding {{=form.custom.submit}} doesn't
> > let me send the form.
> > How should I add submit button to the page, so I would get a default
> > fields validation and form submit functionallity?
>
> > Best regards.