Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
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
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

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. 

How to make fields required?
Can we not use this for the checkbox issue (accept terms and conditions)?