>
>
> Maybe show what you tried. I would think you could make either the field 
> label or comment (the comment appears after the input field) a link, and 
> trigger the modal dialog with an onclick attribute or a jQuery event 
> handler.
>
> Anthony
>

ok,
in models/db.py I have put (but the link in comment doesn't work):

auth.settings.extra_fields['auth_user']= [
  Field('accept_conditions','boolean',default=False,label='accept 
conditions',  comment=A('view  
conditions',callback=URL('a.link("conditions")'),target="web2py_user_form"))]

and I have a view/default/user.html like this (you can see 
{{=a.link('conditions')}} just put for testing and it works correctly but 
is not what I want, because is a string not related to a check box and a 
database field)


{{extend 'layout.html'}}
<h2>{{=T( request.args(0).replace('_',' ').capitalize() )}}</h2>
<div id="web2py_user_form">
{{=form}}
{{if request.args(0)=='register':}}
    {{a=PluginMModal(title='Conditions',content="""bla bla 
bla""",close='Close',width=70,height=70)}}
    {{=a}}

I accept  {{=a.link('conditions')}}


{{pass}}
{{if request.args(0)=='login':}}
{{if not 'register' in auth.settings.actions_disabled:}}
<br/><a href="{{=URL(r=request,args='register')}}">{{=T('register')}}</a>
{{pass}}

{{if not 'request_reset_password' in auth.settings.actions_disabled:}}
<br/><a href="{{=URL(r=request,args='request_reset_password')}}">{{=T('lost 
password?')}}</a>
{{pass}}
{{pass}}
</div>

<script language="javascript">
<!--
 jQuery("#web2py_user_form input:visible:enabled:first").focus();
//-->
</script> 

-- 



Reply via email to