Hi , i want to mark certain fields as mandatory in front-end course creation like the Course name is now set as mandatory. kindly let me know the code js/php which validates the fields so that i can customize them and add some more rules to validate them .
This reply has been marked as private.
This is very rudimentary validation anyone with instructor account can easily spam the site :( you have any other better validation in place ?
The title validation is not available while editing the course.
I need the user to fill course title, course images , course duration and unite unit duration as necessary fields could you send me a code snippet for this ?
@rajamohammed
What kind of validation you want to add on the fields. So I can assist you better
I want to make the fields required by default
@rajamohammed,
This can be possible using javascript code.
Do you want description tab also as a required field? Let me know so I'll share the javascript code to achieve this.
So that you can take it as a reference and add validations on other fields
Yes Description, Course image, Course duration, Unit Duration All should be a Compulsory field.
@rajamohammed,
Okay, Wait for my next reply
@rajamohammed,
<script>
jQuery(document).ready(function(){
jQuery('#create_course_action').click(function(event){
var featuredimage=$('#course-image').val();
if(featuredimage == '' || /ENTER COURSE IMAGE/i.test(featuredimage)){
alert("Hii");
return;
}
}
});
<script>
Paste this code in wp-admin > WPLMS > Footer > Google Analytics Code
This will work when your course image is empty