TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sourabh Choubey
NA
236
44k
my ckeditor in mvc not work properly
Aug 9 2016 1:30 AM
my ckeditor in mvc not work properly
here is my textarea...
<form>
<td><strong>Description:</strong> </td>
<td style="padding-left: 5%;padding-bottom: 5px;">
@Html.TextAreaFor(x => x.Descriptions, new { @class = "ckeditor", @id = "editor1" })
@Html.ValidationMessageFor(model => model.Descriptions)
<span id="erroreditor1" style="color: red;"></span>
</td>
</form>
here is my script....
function validateForm() {
debugger
$('#form').validate({
ignore: [],
rules:{
editor1: {
required: function () {
CKEDITOR.instances.editor1.updateElement();
}
}
},
messages: {
Job_Title: "Required",
Job_Location: "Required",
jobid: "Required",
Job_Cat: "Required",
editor1: "Required"
},
/* use below section if required to place the error*/
errorPlacement: function (error, element) {
if (element.attr("name") == "editor1") {
error.insertBefore("textarea#editor1");
} else {
error.insertBefore(element);
}
}
});
var Title = document.getElementById('errortitle');
var title = document.getElementById('title');
if (title.value == '') {
errortitle.innerHTML = "The Title is required";
errortitle.focus();
return false;
}
else
{
errortitle.innerHTML = "";
}
var Company = document.getElementById('company');
var cerror = document.getElementById('errorcompany');
if (Company.value == '') {
errorcompany.innerHTML = "The companyname is required"
errorcompany.focus();
return false;
}
else
{
errorcompany.innerHTML = "";
}
var designation = document.getElementById('designation').value;
if(designation=="0")
{
errordesignation.innerHTML = "The Designation is required"
errordesignation.focus();
return false;
}
else
{
errordesignation.innerHTML = "";
}
var qualification = document.getElementById('qualification').value;
if (qualification == "0") {
errorqualification.innerHTML = "The Qualification is required"
errorqualification.focus();
return false;
}
else {
errorqualification.innerHTML = "";
}
var description = document.getElementById('editor1').length;
if (description <= 0) {
erroreditor1.innerHTML = "The Description is required";
erroreditor1.focus();
return false;
}
else {
erroreditor1.innerHTML = "";
}
var seokeywords = document.getElementById('seokeywords');
if (seokeywords.value == '') {
errorseokeywords.innerHTML = "The SeoKeywords is required";
errorseokeywords.focus();
return false;
}
else {
errorseokeywords.innerHTML = "";
}
var seokeytitle = document.getElementById('seokeytitle');
if (seokeytitle.value == '') {
errorseokeytitle.innerHTML = "The SeoKeyTitle is required";
errorseokeytitle.focus();
return false;
}
else {
errorseokeytitle.innerHTML = "";
}
var seodescription = document.getElementById('seodescription');
if (seodescription.value == '') {
errorseodescription.innerHTML = "The SeoDescription is required";
errorseodescription.focus();
return false;
}
else {
errorseodescription.innerHTML = "";
}
}
<script src="~/Content/ckeditor/jquery-1.11.1.js" type="text/javascript"></script>
<script src="~/Content/ckeditor/jquery.validate.js" type="text/javascript"></script>
Reply
Answers (
1
)
No error and not getting email to recepient inbox
How can I build a web app to help me schedule posts?