0

if u see this function <?= input_txt('+order_id+') ?>
have jquery variable but jquery send error

function order_status(type, order_id) {
    var value = type.value;

    var info = document.getElementById("cancel_id_" + order_id).value;
    document.getElementById("my_cancel_info").innerHTML = "Determine the reason for cancellation of the order number " + info;
    document.getElementById("cancelled_info").innerHTML = '<?= input_txt('+order_id+') ?>';




    if (value == 2) {
        $('#order_cancelled').modal('show');
    }
}

1 Answer 1

2

You first need to understand the order in which PHP and javascript execute. PHP is rendered server-side, while javascript is rendered client-side. I suggest that you look into http://api.jquery.com/jquery.ajax/ where you can pass your javascript variable to a PHP script via AJAX and then return your result.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.