Skip to content

Commit

Permalink
check null & white space title before submit
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Aug 9, 2012
1 parent 251cb89 commit afc7339
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion views/new.jade
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ block prepend script
});

socket.on('page name is ok', function(){
$('#title').popover('hide');
if( $('#title').val().replace(/ /g, "") !== "" )
$('#title').popover('hide');
});

$('#title').keyup(function(){
Expand Down Expand Up @@ -173,3 +174,14 @@ block prepend script
});
})
script(type="text/javascript", src="/scripts/fileupload.js")
script
//before write post
$('#newpost').live("submit", function() {
if( $('#title').val().replace(/ /g, "") == "" ) {
$('#title').popover({title:"Title text is wrong", content: "Please, fill in the title text"});
$('#title').popover('show');
return false;
}
$('#title').popover('show');
return true;
});

0 comments on commit afc7339

Please sign in to comment.