This is normal form submission to codeigniter framework. This is a ajax form submission. How to convert this to jason and send to below URL?
data: 'question=' + question + '&idquestion_table=' + idquestion_table + '&answer_1=' + answer_1 + '&answer_2=' + answer_2 + '&answer_3=' + answer_3 + '&answer_4=' + answer_4 + '&correct_answer=' + correct_answer + '&category=' + category,
url: "<?php echo base_url('index.php/admin_question_controller'); ?>",
type: 'put',
Hopefully my code can help you to deal with your issue
<html>
<input type="button" value="button" id="ID1" />
</html>
<script>
$("#ID1").click(function () {
var user = {
username:'***@gmail.com',
password:'!aA1234'
};
$.ajax({
type: 'POST',
url: 'http://***/index.php',
data: user,
datatype: "json",
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
},
success: function (data) {
alert(data)
}
});
});
</script>