php - How to input with method Post in javascript


I have a code input in javascript code, but it's use method GET

$('#frm-example').on('submit', function(e){ //on submit
    var judul   = document.getElementById("judul_survey").value;
    var kategori= document.getElementById("id_kategori").value;
    var target  = document.getElementById("viewSelector").value;
    window.location.href = "<?php echo base_url() ?>survey/simpan_survey?judul_survey="+judul+"&id_target="+target+"&id_kategori="+kategori;

I want to change with method Post, please help me.
Note: I've used the$ _POST method in its php process


People are also looking for solutions to the problem: php - composer laravel install: "" file could not be downloaded


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.