diff --git a/forum/static/js/forum.js b/forum/static/js/forum.js
index 866f03e..51d0069 100644
--- a/forum/static/js/forum.js
+++ b/forum/static/js/forum.js
@@ -89,6 +89,44 @@ function createForum(url, topic) {
/*
*
+* Function to load edit forum's form and set the submit function
+*
+*/
+function editForum(url, forum) {
+ $.ajax({
+ url: url,
+ data: {'pk': forum},
+ success: function(data) {
+ $(".forum_form").html(data);
+ //$("#id_topic").val(topic);
+
+ $('.date-picker').datepicker();
+
+ var frm = $('#forum_create');
+ frm.submit(function () {
+ $.ajax({
+ type: frm.attr('method'),
+ url: frm.attr('action'),
+ data: frm.serialize(),
+ success: function (data) {
+ $('.forum_view').html(data);
+
+ $("#editForum").modal('hide');
+ },
+ error: function(data) {
+ $(".forum_form").html(data.responseText);
+ }
+ });
+ return false;
+ });
+ }
+ });
+
+ $("#editForum").modal();
+}
+
+/*
+*
* Function to delete a forum
*
*/
diff --git a/forum/templates/forum/forum_form.html b/forum/templates/forum/forum_form.html
index 5c585e0..dd7fe3d 100644
--- a/forum/templates/forum/forum_form.html
+++ b/forum/templates/forum/forum_form.html
@@ -1,7 +1,7 @@
{% load static i18n %}
{% load widget_tweaks %}
-