Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Some bug fixed. #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mrmasoud wants to merge 9 commits into BlogEngine:master from mrmasoud:master
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update blog.js
Email validation added.
Error style improved!
  • Loading branch information
mrmasoud committed Apr 28, 2016
commit f0b54befcd26d024061f1918832c1fd5416ae32c
22 changes: 18 additions & 4 deletions BlogEngine/BlogEngine.NET/Scripts/Auto/blog.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,32 @@ BlogEngine = {
validateAndSubmitCommentForm: function () {

if (BlogEngine.comments.nameBox.value.length < 1) {
BlogEngine.$("status").innerHTML = "Required";
BlogEngine.$("status").className = "warning";
BlogEngine.$("status").className = "alert alert-danger";
BlogEngine.$("status").innerHTML = "Name is required";// TODO Globalization!
BlogEngine.$("status").style.display = 'block';
BlogEngine.$("txtName").focus();
return false;
}
if (BlogEngine.comments.emailBox.value.length < 1) {
BlogEngine.$("status").innerHTML = "Required";
BlogEngine.$("status").className = "alert alert-danger";
BlogEngine.$("status").innerHTML = "Email is required";// TODO Globalization!
BlogEngine.$("status").style.display = 'block';
BlogEngine.$("txtEmail").focus();
return false;
} else {
var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (!re.test(BlogEngine.comments.emailBox.value)) {
BlogEngine.$("status").className = "alert alert-danger";
BlogEngine.$("status").innerHTML = "Email address is not valid";// TODO Globalization!
BlogEngine.$("status").style.display = 'block';
BlogEngine.$("txtEmail").focus();
return false;
};
}
if (BlogEngine.comments.contentBox.value.length < 1) {
BlogEngine.$("status").innerHTML = "Required";
BlogEngine.$("status").className = "alert alert-danger";
BlogEngine.$("status").innerHTML = "Comment text is required";// TODO Globalization!
BlogEngine.$("status").style.display = 'block';
BlogEngine.$("txtContent").focus();
return false;
}
Expand Down

AltStyle によって変換されたページ (->オリジナル) /