Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.2k views
in Plugins by

 

i added the below code to qa-page-register.php
when user check the I am a lawyer checkbox must enter his Lawnumber, and that works so far
 
how to get the entered Lawnumber automatically in profile
 
 
$lawyer=qa_post_text('lawyer');
$lawnumber=qa_post_text('lawnumber');
 
if($lawyer == "1" && $lawnumber == "")
$errors['lawnumber']='Lawnumber must not be empty.'; 
 
 
 
                'lawyer' => array(
                'type' => 'checkbox',
                'label' => 'I am a lawyer',
                'tags' => 'NAME="lawyer" ID="lawyer"',
                'value' => @$lawyer ? true : false,
               'error' => qa_html(@$errors['lawyer']),
                ),
 
                 'lawnumber' => array(
                 'type' => 'text',
                 'label' => 'Lawnumber',
                 'tags' => 'NAME="" ID=""',
                 'value' => '',
                'error' => qa_html(@$errors['lawnumber']),
                ),
 
 
 
 
 
 
After Register
 
 
 
 
 
Q2A version: 1.5.3

1 Answer

+1 vote
by

Keep modifying the same qa-page-register.php file. In the line after $userid=... call qa_db_user_profile_set(...) from qa-db-users.php to set the appropriate field in the user profile for the law number. 

by
How to make fields required?
by
Can we not use this for the checkbox issue (accept terms and conditions)?
http://www.question2answer.org/qa/28170/setup-accept-terms-and-conditions-default-registration-form
...