diff --git a/js/ajax.js b/js/ajax.js
index d3065475..e1c91536 100644
--- a/js/ajax.js
+++ b/js/ajax.js
@@ -23,12 +23,12 @@ $(window).ready(function() {
$form.submit(function() {
if (do_not_ajax)
return true;
- var form = this;
+ var form = $(this).find('form')[0];
var submit_txt = $(this).find('input[type="submit"]').val();
if (window.FormData === undefined)
return true;
- var formData = new FormData(this);
+ var formData = new FormData(form);
formData.append('json_response', '1');
formData.append('post', submit_txt);
@@ -46,7 +46,7 @@ $(window).ready(function() {
};
$.ajax({
- url: this.action,
+ url: '/post.php',
type: 'POST',
xhr: function() {
var xhr = $.ajaxSettings.xhr();
@@ -137,9 +137,9 @@ $(window).ready(function() {
return false;
});
};
- setup_form($('form[name="post"]'));
+ setup_form($('div#post-form-outer'));
$(window).on('quick-reply', function() {
- $('form#quick-reply').off('submit');
- setup_form($('form#quick-reply'));
+ $('div#quick-reply').off('submit');
+ setup_form($('div#quick-reply'));
});
});
diff --git a/js/multi-image.js b/js/multi-image.js
index db4c6bd2..6199bef0 100644
--- a/js/multi-image.js
+++ b/js/multi-image.js
@@ -15,14 +15,14 @@ function multi_image() {
$(document).on('click', 'a.add_image', function(e) {
e.preventDefault();
- var images_len = $('form:not([id="quick-reply"]) [type=file]').length;
+ var images_len = $('div#post-form-outer [type=file]').length;
if (!(images_len >= max_images)) {
var new_file = '
';
$('[type=file]:last').after(new_file);
if ($("#quick-reply").length) {
- $('form:not(#quick-reply) [type=file]:last').after(new_file);
+ $('#quick-reply [type=file]:last').after(new_file);
}
if (typeof setup_form !== 'undefined') setup_form($('form[name="post"]'));
}