Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot post data with jQuery Form Plugin
    primarykey
    data
    text
    <p>I have the following code (works fine) that i want to change it into jQuery Form Plugin ajaxForm() :</p> <pre><code>$("#replysubmit").click(function() { var msg = $("#message").val(); var attach = $("#attach").val(); var id = $("input[name=hidden-ticketID]").val(); if(msg == "") { alert("not null"); $("#message").focus(); return false; } $.ajax({ type: 'POST', dataType: 'json', url: '/TicketSystem/support/view', async: false, data: {id: id, msg: msg, attach: attach}, success: function(json) { $.post('/TicketSystem/support/ajaxmsg', { date: json.date, msg: json.msg }, function(data){ var newData = $('&lt;div&gt;').addClass('msgBlock').html(data).hide(); newData.appendTo($('.msgWrapper')).slideDown('normal'); goToByScroll('reply-form'); }); $("#message").val(''); $("#attach").val(''); } }); return false;}); </code></pre> <p>and this is the ajaxForm() i wrote :</p> <pre><code>$(document).ready(function() { var msg = $("#message").val(); var attach = $("#attach").val(); var id = $("input[name=hidden-ticketID]").val(); var options = { //target: '#output1', // target element(s) to be updated with server response beforeSubmit: showRequest, // pre-submit callback success: showResponse, // post-submit callback // other available options: url: '/TicketSystem/support/view', type: 'POST', dataType: 'json', data: {id: id, msg: msg, attach: attach}, //clearForm: true // clear all form fields after successful submit //resetForm: true // reset the form after successful submit // $.ajax options can be used here too, for example: //timeout: 3000 }; // bind form using 'ajaxForm' $('#user-reply-form').ajaxForm(options); }); </code></pre> <p>The post data from the ajaxForm are wierd... and my php code couldnt receive anything from it except the file upload now works.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload