JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" href="http://www.jeasyui.com/easyui/themes/icon.css">
<script src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<div>
    Enter color: <input id="colorCB" type="text">
    <p>
    Enter dob: <input id="dobDB" type="text">
</div>

JavaScript

var neverEndingLoopStopper = 20;

   var colorData = [{
        value: '0',
        text: 'red'
    }, {
        value: '1',
        text: 'yellow'
    }, {
        value: '2',
        text: 'green'
    }];

$(function(){
    $('#colorCB').combobox({
        width: 90,
        data: colorData,
        value: '1',
        onChange: function (newValue, oldValue) {
            console.log('onchange fired...combobox, newValue:' + newValue + ";oldValue:" + oldValue);

            saveField($(this).combobox('getValue'), function () {
                console.log('reseting combobox to oldValue:' + oldValue);
                $('#colorCB').combobox('initValue', oldValue);
            });
		}
	});    
    
    $('#dobDB').datebox({
        width: 90,
    	value: '6/1/2012',
        onChange: function (newValue, oldValue) {
            console.log('onchange fired...datebox, newValue:' + newValue + ";oldValue:" + oldValue);

            saveField($(this).datebox('getValue'), function () {
                console.log('reseting datebox to oldValue:' + oldValue);
                $('#dobDB').datebox('initValue', oldValue);
            });
		}
    });
});

function saveField(fieldValue, resetFN) {
	console.log('db error occured while saving.. call reset function..');
    resetFN();
}