diff options
Diffstat (limited to 'yaksh/static')
-rw-r--r-- | yaksh/static/yaksh/js/course.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/yaksh/static/yaksh/js/course.js b/yaksh/static/yaksh/js/course.js index 5b79e68..3e214be 100644 --- a/yaksh/static/yaksh/js/course.js +++ b/yaksh/static/yaksh/js/course.js @@ -35,4 +35,49 @@ $(".reject").change( function(){ });
}
});
+
+$(function() {
+ $('textarea#email_body').froalaEditor({
+ heightMin: 100,
+ heightMax: 200
+ })
+ });
+
+var status;
+var btn_name;
+
+$("#send_mail").click(function(){
+ btn_name = "send_mail";
+ var subject = $("#subject").val();
+ var body = $('#email_body').val();
+ if (subject == '' || body == ''){
+ status = false;
+ $("#error_msg").html("Please enter email details");
+ $("#dialog").dialog();
+ }
+ else{
+ status = true;
+ }
+});
+
+$('#reject-form').submit(function(eventObj) {
+ if (btn_name == 'send_mail'){
+ if(status == false){
+ return false;
+ }
+ }
+ var selected = [];
+ $('#reject input:checked').each(function() {
+ selected.push($(this).attr('value'));
+ });
+ if(selected.length > 0){
+ return true;
+ }
+ else{
+ $("#error_msg").html("Please select atleast one user");
+ $( "#dialog" ).dialog();
+ return false;
+ }
+});
+
});
|