diff options
-rw-r--r-- | yaksh/static/yaksh/js/course.js | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/yaksh/static/yaksh/js/course.js b/yaksh/static/yaksh/js/course.js index 74ad37c..0eeb017 100644 --- a/yaksh/static/yaksh/js/course.js +++ b/yaksh/static/yaksh/js/course.js @@ -43,37 +43,30 @@ $(function() { })
});
-var status;
-var btn_name;
-
$("#send_mail").click(function(){
- btn_name = "send_mail";
var subject = $("#subject").val();
var body = $('#email_body').val();
+ var status;
if (subject == '' || body == ''){
status = false;
- $("#error_msg").html("Please enter email details");
+ $("#error_msg").html("Please enter mail details");
$("#dialog").dialog();
}
else{
status = true;
}
+ return status;
});
$('#send_mail_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){
+ if(selected.length > 0) {
return true;
}
- else{
+ else {
$("#error_msg").html("Please select atleast one user");
$( "#dialog" ).dialog();
return false;
|