Normal button for form validation

Simply make a record. If the button is not a submission button in the form form, there is no form submission event. We need to register an event for the button separately.

Here, register a form validation event.

$("#btnSave").click(function () {
	var groupId = $("#groupId").val();
	if(validform().form()) {
	    //Through form validation, write your own code below./ / form validation is successfully executed.Var url = path + "/GroupCustomer.do? Action=toAddAndUpdate& id=" +gRoupId;$("#editWin").Window ("close");GetVpnInfoData ();$.ajax ({Method:'get',Async:faLSE,Data: $("#data_form").Serialize (),Url:url,Success:function () {$("#editWin").WindOw ("close");GetVpnInfoData ();}})}});The // normal button triggers the form validation event /* Key adds a return and returns a valiDate object, this object has a form method, and it returns whether to pass validation * /Function validform () {Return $("#data_form").Validate ({)RulEs:{ARName: {required: true}},Messages: {ARName: {required: "must fill! "}},ErrorClass: "cusErrorPanel",ErrorPlacement:function (error, element) {ErrOr.appendTo ("#erroInfo");}});}/ / registry verification$(validform ());

  

 

Leave a Reply

Your email address will not be published. Required fields are marked *