<fieldset class=?"crm-public-form-item crm-group payment_options-group" style=?"display:? block !important;? visibility:? visible;?">?
<div class=?"crm-public-form-item crm-section payment_processor-section" style=?"display:? block;?">?
<div class=?"content">
?<input class=?"payment_processor_1 crm-form-radio" value=?"5" type=?"radio" id=?"CIVICRM_QFID_5_payment_processor_id" name=?"payment_processor_id">
<input class=?"payment_processor_2 crm-form-radio" value=?"3" type=?"radio" id=?"CIVICRM_QFID_3_payment_processor_id" name=?"payment_processor_id">?
</div>?
</div>?
</fieldset>?
<div id=?"crm-submit-buttons" class=?"crm-submit-buttons" style=?"visibility:? visible;? display:? block;?">
? <button class=?"crm-form-submit default validate crm-button crm-button-type-upload crm-button_qf_Main_upload" value=?"1" type=?"submit" name=?"_qf_Main_upload" id=?"_qf_Main_upload-bottom">?…?</button>?
</div>?
I have this html block and I am bit stuck with validation. Conditions are
- payment_options-group fieldset must present on this page
- And at least one of the radio button is checked
- Then show crm-submit-buttons div
- Otherwise hide crm-submit-buttons div
I have tried the following but could not get it to work, also not sure how to define the condition payment_options-group fieldset must present on this page. This is important because "crm-submit-buttons" is controlled by other fieldset, which is not present on this page.
if( $("#payment_options-group").val().length === 1 ) {
$("div#crm-submit-buttons").show();
}
else {
$("div#crm-submit-buttons").hide();
}
Any help would be appreciated. Thanks in advance.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…