Hello!
Can you help me!
Here is my issue
I have a form that has many editor. i want to submit that form by ajax after i clicked save button. here is my code
$("#btnSave_PositionMaster").click(function (e) { e.preventDefault(); $("#calculateLoadingIndicator").show(); $("#grdCostOfFunds").igGrid("saveChanges"); $("#grdFeeSchedule").igGrid("saveChanges", function (data) { if (data.Success != true) { //show error } }); $.ajax({ url: '@Url.Action("Edit","Position")', type: 'post', dataType: 'json', data: $('#Frm_PositionMaster').serialize(), success: function (data) { $("#calculateLoadingIndicator").hide(); if (data.Status == "Ok") { $("#lblErrorMessage").empty(); alert("Position is saved"); //window.location.reload(); } else { $("#lblErrorMessage").empty(); $("#lblErrorMessage").append(data.SaveErrorMessage); } } }); });
My issuer is i can not validate form editor and show error if it is invalid
Can you suggest me 1 solution to resolve this problem!
I need to urgent helper.
Thanks you very much!
it is a good idea. thanks you very much
Hello Cuong Tran,
You can use jQuery selectors to apply the same options to every editor at once.
I would recommend setting the formSubmit and onsubmit options to trigger the validation automatically before the form is submitted. The below code shows an example of how you can achieve this:
$(".editor").igEditor("option", "validatorOptions", {onsubmit: true, formSubmit: true});
This will apply the onsubmit and formSubmit options to each element with a class of "editor".
If you have any questions or concerns with this, please let me know.
thanks for support
but i have so many editor. about 100 editor. do you have any method that can fire validate function and show message for all editor before submited
thanks you very much!
Thank you for posting in our forums!
You can trigger the validators to run by setting certain options. The formSubmit, onblur, onchange, and onsubmit options are some options that will trigger the validation automatically. You can also call the validate method.
You can also see a sample of using the validators here:
http://www.igniteui.com/editors/validation
The following documentation also provides information on setting up editors' validation settings in MVC:
http://www.igniteui.com/help/configuring-asp.net-mvc-validation
If you need further assistance with this, please let me know.
who can help me?