Skip to content Skip to sidebar Skip to footer

Form Inout Getting Appended After The Submit Button

I have the following javascript function txJ$(document).ready(function () { // Hide the error display, as there is currently no error txJ$('#TokenProxy_Error').css('displa

Solution 1:

why dont you try something like this..

in your form put a div with some id like say <div id="div1"></div> and your javascript should be like

var MyForm = txJ$("#div1");

        txJ$('<input type="hidden">').attr({
            id: 'token',
            name: 'token'
        }).val(token).appendTo(MyForm);
    txJ$('<input type="hidden">').attr({
            id: 'cvv',
            name: 'cvv'
        }).val(txCvv).appendTo(MyForm);

let me know if you face any other issue...


Solution 2:

You can use jQuery prepend function:

$("input[type='submit']").prepend('<input type="hidden" id="token" name="token" value="'+ token + '">');
$("input[type='submit']").prepend('<input type="hidden" id="cvv" name="cvv" value="'+ txCvv + '">');

Post a Comment for "Form Inout Getting Appended After The Submit Button"