Please add below code to make customer inputs i.e Text and image input as Mandatory. You can customize the text displayed to the end customer. 


<script>
function addToCart(_26){
if(elementExists("userText") && $j("#userText").val()==""){
alert("Please Enter Text");
exit();
}

else if(elementExists("userPhotoName") && $j("#userPhotoName").val()==""){
alert("Please enter image");
}

else
{
$j("#adding_in_cart").removeAttr("href");
if(elementExists("product_option_id")){
if($j("#product_option_id").val()==""){
alert("Please select option");
exit();
}else{
var _27=parseInt($j("#max_available_quantity").val());
var _28=parseInt($j("#quantity").val());
if(isNaN($j("#quantity").val())){
alert("Please select valid quantity");
exit();
}else{
if($j("#quantity").val()==""){
alert("Please select quantity");
exit();
}else{
if(_28<1){
alert("Minimum select quantity is 1(one)");
exit();
}else{
if(_28>_27&&_27!=-1){
alert("Max order quantity allowed for this product is "+_27);
exit();
}else{
var _29="productId="+$j("#product_id").val()+"&productOptionId="+$j("#product_option_id").val()+"&quantity="+$j("#quantity").val();
if(elementExists("userText")&&elementExists("userPhotoName")){
_29="productId="+$j("#product_id").val()+"&productOptionId="+$j("#product_option_id").val()+"&quantity="+$j("#quantity").val()+"&userText="+$j("#userText").val()+"&userPhotoName="+$j("#userPhotoName").val();
}else{
if(elementExists("userText")&&!elementExists("userPhotoName")){
_29="productId="+$j("#product_id").val()+"&productOptionId="+$j("#product_option_id").val()+"&quantity="+$j("#quantity").val()+"&userText="+$j("#userText").val();
}else{
if(!elementExists("userText")&&elementExists("userPhotoName")){
_29="productId="+$j("#product_id").val()+"&productOptionId="+$j("#product_option_id").val()+"&quantity="+$j("#quantity").val()+"&userPhotoName="+$j("#userPhotoName").val();
}
}
}
$j.ajax({type:"get",url:"addtocart.action",data:_29,success:function(msg){
$j("#emptycart").html(msg);
$j("#number_of_item").html($j("#numberOfItems").val());
if(_26!=null&&_26!=undefined&&_26==2){
showDialog("enquiryOnly");
}else{
if(_26!=null&&_26!=undefined&&(_26==3||_26==4||_26==5)){
showCartDialogOnTop();
}else{
showCartDialog();
}
}
},error:function(_2a,_2b){
if(_2a.getResponseHeader("ajax-server-side-error")==null){
alert("Either your session is expired or Service is under maintainance! Try after some time.");
}else{
alert(_2a.getResponseHeader("ajax-server-side-error"));
}
}});
}
}
}
}
}
}else{
var _27=parseInt($j("#max_available_quantity").val());
var _28=parseInt($j("#quantity").val());
if(isNaN($j("#quantity").val())){
alert("Please select valid quantity.");
exit();
}else{
if($j("#quantity").val()==""){
alert("Please select quantity");
exit();
}else{
if(_28<1){
alert("Minimum order quantity is 1(one)");
exit();
}else{
if(_28>_27&&_27!=-1){
alert("Max order quantity allowed for this product is "+_27);
exit();
}else{
var _29="productId="+$j("#product_id").val()+"&quantity="+$j("#quantity").val();
if(elementExists("userText")&&elementExists("userPhotoName")){
_29="productId="+$j("#product_id").val()+"&quantity="+$j("#quantity").val()+"&userText="+$j("#userText").val()+"&userPhotoName="+$j("#userPhotoName").val();
}else{
if(elementExists("userText")&&!elementExists("userPhotoName")){
_29="productId="+$j("#product_id").val()+"&quantity="+$j("#quantity").val()+"&userText="+$j("#userText").val();
}else{
if(!elementExists("userText")&&elementExists("userPhotoName")){
_29="productId="+$j("#product_id").val()+"&quantity="+$j("#quantity").val()+"&userPhotoName="+$j("#userPhotoName").val();
}
}
}
$j.ajax({type:"get",url:"addtocart.action",data:_29,success:function(msg){
$j("#emptycart").html(msg);
$j("#number_of_item").html($j("#numberOfItems").val());
if(_26!=null&&_26!=undefined&&_26==2){
showDialog("enquiryOnly");
}else{
if(_26!=null&&_26!=undefined&&(_26==3||_26==4||_26==5)){
showCartDialogOnTop();
}else{
showCartDialog();
}
}
},error:function(_2c,_2d){
if(_2c.getResponseHeader("ajax-server-side-error")==null){
alert("Either your session is expired or Service is under maintainance! Try after some time.");
}else{
alert(_2c.getResponseHeader("ajax-server-side-error"));
}
}});
}
}
}
}
}
if(_26!=null&&_26!=undefined&&_26==4){
$j("#adding_in_cart").attr("href","javascript:addToCart(4);");
$j("html, body").animate({scrollTop:"0px"},300);
}else{
if(_26!=null&&_26!=undefined&&_26==3){
$j("#adding_in_cart").attr("href","javascript:addToCart(3);");
$j("html, body").animate({scrollTop:"0px"},300);
}else{
$j("#adding_in_cart").attr("href","javascript:addToCart();");
}
}
}
};
</script>