Datagrid Edit mode and data validation via service
By : user3728649
Date : March 29 2020, 07:55 AM
|
Jqgrid custom edit mode and validation
By : Nathanjoshua24
Date : March 29 2020, 07:55 AM
around this issue You can validate the form fields in the beforeSubmit function. In this function you can validate the fields and add the highlight class to the element you want. You can do something like this: code :
beforeSubmit: function(postdata, formid){
//more validations
if ($('#exec').val()==""){
$('#exec').addClass("ui-state-highlight");
return [false,'ERROR MESSAGE']; //error
}
return [true,'']; // no error
},
|
How to exclude a perticular field from unique validation in edit mode in cakephp3.0 validation
By : user6349560
Date : March 29 2020, 07:55 AM
like below fixes the issue I want to validate a field called survey_id which is an input from user for uniqueness. It is working properly and giving the correct response when adding the new record, but when I tried to edit this record it is giving an error [unique] => Provided value already exist. So what I want is to exclude the survey_id of the current record from uniqueness check and if user input some other value for survey_id it should check for uniqueness search. , It will work with this validation rule code :
$validator
->requirePresence('survey_id', __('msg_required'))
->notEmpty('survey_id', __('msg_required'))
->maxlength('survey_id', 32, __('msg_maxlength'))
->alphaNumeric('survey_id', __('msg_surveyid_format'))
->add('survey_id', 'custom', [
'rule' => function ($value, $context) {
if (!empty($context['data']['projectId'])) { $values = array($context['data']['projectId']); } else { $values = array(); }
$data = $this->getSurveyId($value, $values);
return (!empty($data)) ? false : true;
},
'message' => __('msg_surveyid_exsist')]);
return $validator;
}
public function getSurveyId($surveyId = null, $exclude = null) {
$where = array('p.survey_id' => $surveyId);
if (!empty($exclude) && is_array($exclude)) {
$where[] = array('p.id NOT IN' => $exclude);
}
return $this->db->newQuery()
->select('*')
->from(['p' => 'projects'])
->where($where)
->execute()
->fetch('assoc');
}
|
Kendo validation message in inLine Edit mode kendo grid not working through Data annotation
By : Cuong Phong
Date : March 29 2020, 07:55 AM
I wish did fix the issue. For the validations to work for the columns using Editor Templates you need to add the following in your Editor Templates .HtmlAttributes(Html.GetUnobtrusiveValidationAttributes("Validation", code :
(Html.AthenaTransportDdl("GetPricingPolicyTypes", "Enterprise", HttpVerbs.Post)
.Name("PricingPolicyType")
.DataTextField("Label")
.DataValueField("Id")
.AutoBind(false)
.Filter("contains")
.HtmlAttributes(Html.GetUnobtrusiveValidationAttributes("Validation",
ViewData.ModelMetadata))
.OptionLabel(Html.GetResource(AthenaWeb.Models.Common.XmlResourceNames.CommonXml, "PricingPolicyTypeOptionLabel"))
)
|
Excel VBA data validation swap only working in debug mode
By : Mogtan Mog Tan
Date : March 29 2020, 07:55 AM
|