Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82782

data validation using Json inside "onPreSubmit"

$
0
0
I am using latest version of datatable editor. I am looking for a solution to compare the selected data with json data (data already available in database- in order to avoid repeated entry).
	
			"events": {
						"onPreSubmit": function ( o ) {
							
							
							function(json) {
                    for (var i = 0; i < json.length; i++) {
                 	///item is the field name and json	response itemList gives me  all the available in database	//		
			if ( o.data.item == "json[i].item" ) {	this.error('item', 'item already exists in database');return false;}
							
							 };
							
							}}	
Let me know what i am missing here. Thank you

Viewing all articles
Browse latest Browse all 82782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>