• Resolved PB

    (@ohtusabes)


    Hi @codepeople2

    I need the ‘Hipercapnia’ field in the form to prompt a double confirmation, showing a custom message such as ‘¿Está seguro?’ upon selection, with options to cancel or confirm.

    Is it posible?

    Thank you

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author CodePeople2

    (@codepeople2)

    Hello @ohtusabes

    Yes, that’s possible and very simple. The strength of our plugin is that you have total control over the form. Please watch the following video:

    https://resources.developers4web.com/cff/tmp/2025/04/25/video_o.mp4

    I inserted a radio button field (fieldname1) with two choices, Yes, and No. So, I inserted a calculated field to be used as an auxiliary with the following equation:


    (function(){
    if(fieldname1 == 'Yes' && typeof checked_previously === 'undefined'){
    checked_previously = true;
    let user_answer = window.confirm('Are you sure?');
    if(NOT(user_answer)) getField(fieldname1|n).setVal('No');
    }
    })()

    I included the variable checked_previously to ask for user confirmation only the first time he selects the “Yes” option.

    If you need we customize your form, you can contact us via the plugin website. Contact Us

    Best regards.

    Thread Starter PB

    (@ohtusabes)

    Hi @codepeople2

    Thank you very much.

    • This reply was modified 1 year, 1 month ago by PB.
    Thread Starter PB

    (@ohtusabes)

    Hi @codepeople2

    I tested the function based on your instructions, and it works perfectly. However, my goal is to allow selection between one option or another, with confirmations for both choices. If ‘Accept’ is selected, it’s fine. If not, I would like all options to be deselected and the process to start over. The radio button field is in fieldname4, and the equation (auxiliary) is in fieldname44.

    I used the following equation but it doesn´t work as expected:

    (function() {
    // Verifica si el campo de radio button está seleccionado
    if (fieldname4 && fieldname4 !== '' && typeof window._hipercapnia_confirmed === 'undefined') {
    window._hipercapnia_confirmed = false; // Variable para trackear confirmación

    // Solo lanza la confirmación si está seleccionado "Sí" o "No"
    if (fieldname4 === 'Sí') {
    let mensaje = '⚠️ Usted seleccionó "Hipercapnia: Sí".\n\n¿Confirma que el PCO2 es ≥ 46 mmHg?';
    let confirmacion = window.confirm(mensaje);

    if (!confirmacion) {
    getField('fieldname4').setVal(''); // Deja el campo vacío si el usuario cancela
    window._hipercapnia_confirmed = false;
    } else {
    window._hipercapnia_confirmed = true;
    }
    } else if (fieldname4 === 'No') {
    let mensaje = '⚠️ Usted seleccionó "Hipercapnia: No".\n\n¿Confirma que el PCO2 es < 46 mmHg?';
    let confirmacion = window.confirm(mensaje);

    if (!confirmacion) {
    getField('fieldname4').setVal(''); // Deja el campo vacío si el usuario cancela
    window._hipercapnia_confirmed = false;
    } else {
    window._hipercapnia_confirmed = true;
    }
    }
    }
    })();

    Any help?

    Plugin Author CodePeople2

    (@codepeople2)

    Hello @ohtusabes

    If you need us to implement this feature on your form, please reach out to us directly through the plugin website. Contact Us

    Best regards.

    Thread Starter PB

    (@ohtusabes)

    Hi @codepeople2

    I´ll do. Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Double check’ is closed to new replies.