Hi @companyatif,
Our developer have managed to figure out a workaround, could you please try this snippet and see how it goes?
<?php
add_action( 'forminator_before_form_render', 'wpmudev_checkbox_field_form', 10, 5 );
function wpmudev_checkbox_field_form( $id, $form_type, $post_id, $form_fields, $form_settings ) {
if ( 1388 == $id ) { // Please change the form ID.
add_action( 'forminator_field_multiple_markup', 'wpmudev_checkbox_field_selection', 10, 5 );
}
}
function wpmudev_checkbox_field_selection( $html, $id, $required, $options, $value_type ) {
if ( strpos( $id, 'checkbox-1' ) !== false ) {
foreach ( $options as $key => $value ) {
$pieces = explode( '<br />', $value['label'] );
$date = implode( '<br />', array_slice( $pieces, 0, 1 ) );
$date = strtotime( str_replace( array( '. ', '-' ), '', $date ) );
$date_now = time();
if ( $date_now > $date ) {
$html = str_replace( 'value="'.$value['value'].'"', 'value="'.$value['value'].'" disabled', $html );
}
}
}
return $html;
}
You’ll have to update the following line in the above code to your form ID.
Suppose the from ID is 123 then the following line will change from:
<span style=”color: rgb(23, 43, 77); font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; text-wrap: nowrap; background-color: rgba(9, 30, 66, 0.06);”> if ( 1388 == $id ) { // Please change the form ID. </span>
To:
if ( 123 == $id ) { // Please change the form ID.
<span class=”comment linenumber ds-line-number” data-ds–line-number=”4″ style=”flex-shrink: 0; box-sizing: border-box; padding-left: 8px; margin-right: 8px; text-align: right; user-select: none; float: left; font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; text-wrap: nowrap; background-color: rgba(9, 30, 66, 0.06); display: inline-block !important; min-width: calc(2ch + 16px) !important; color: var(–ds-text-subtlest, #505F79) !important; padding-right: 8px !important;”></span><span style=”color: rgb(23, 43, 77); font-family: SFMono-Medium, "SF Mono", "Segoe UI Mono", "Roboto Mono", "Ubuntu Mono", Menlo, Consolas, Courier, monospace; font-size: 14px; text-wrap: nowrap; background-color: rgba(9, 30, 66, 0.06);”></span>
Please check this link on how to implement the above code as a mu-plugins:
https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins
Best Regards,
Nithin