diff options
author | adityacp | 2017-08-17 10:40:43 +0530 |
---|---|---|
committer | adityacp | 2017-08-17 10:40:43 +0530 |
commit | ca630cd1a3464bc665f06ade7c6e78efa27e93cb (patch) | |
tree | 61436091768b14268d2aead2d0bd39441a896014 | |
parent | b9bf03024cd29440e57a1a647dab022e6719ac46 (diff) | |
download | online_test-ca630cd1a3464bc665f06ade7c6e78efa27e93cb.tar.gz online_test-ca630cd1a3464bc665f06ade7c6e78efa27e93cb.tar.bz2 online_test-ca630cd1a3464bc665f06ade7c6e78efa27e93cb.zip |
Change course.js to validate email form details
-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;
|