Good time of day. It is necessary to make a form in which the field contains two variants of the answer like Radio Yes / No and in the case No it allows you to enter the answer yourself in the text box that appears. A sort of point. Another like in paper questionnaires. The manual smoked, understood a little. PHP and others like him, I do not know only Bitrix. How easier to implement, through its validator or is there a native method in advanced mode. And yes - then the form is sent by mail, so the field should give out either YES or OTHER% usertext%. Thank you in advance.

    1 answer 1

    Can be done through jQuery. If the answer is YES, then hide the field, if NO then show. It will be sent anyway.

    $('input:radio[name="postage"]').change( function(){ if ($(this).val() == 'Yes') { $('#text').hide(); } else { $('#text').show(); } }); 

    Sample code - https://jsfiddle.net/hcj2nja9/

    • You can also use the web forms module in order not to write all the functionality from scratch. And already in the template of the form.result.new component using jQuery show / hide the field. - ka3a