danooh
Forum Replies Created
-
@salihkulangara did you add your radio button via custom code?
I did not find ‘checked’-attribute but you can try adding ‘value’ to the array and assign the pre-checked value when creating the user field:$fields[] = new PMPro_Field( 'status', 'radio', array( 'label' => 'Status', 'options'=>array('single','couple'), 'value' => 'couple' ) );Btw.: I did not test submitting the form.
Update @salihkulangara
You may try my solution by changing the type of field ‘Status’ to select.I will look into multiple conditions on radio fields:
Edit:
I checked the class-pmpro-field.php.
There is a flag implemented to determine whether conditions should be AND’ed or OR’ed (by default ‘depends_or’ is set to false)
Put it like this, adjust values to match yours and it will work with field type ‘radio’'depends_or' =>true, 'depends' => array( array('id' => 'status', 'value' => 'single'), array('id' => 'status', 'value' => 'couple') )Hi @salihkulangara
I am also using the latest version of PMPRO. Can you provide a snippet of your implementation? Like the whole function that you put into the “pmpro-customizations.php”
On my site I am verifying against multiple conditions (if user picks x or y or z out 10 possible options, then to display a specific custom user field) and it does work.- This reply was modified 3 years, 1 month ago by danooh.
Hey @salihkulangara ,
you need to pass an array for the value to be checked. Try the following:
'depends' => array( array('id' => 'status', 'value' => array('Single', 'Couple')) )I faced a similar problem and fixed it using the above mentioned way to achieve an OR-logic with regards the dependancy.
Please let me know if this fixed it for you as well!
Best regards
Daniel