Please look at this example. The 'getValue' method works fine.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic NumberBox - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.min.js"></script>
<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<script>
$(function () {
$('#nb').numberbox({
precision: 0,
filter: function (e) {
if (String.fromCharCode(e.which) == '.') {
return false;
} else {
return $.fn.numberbox.defaults.filter.call(this, e);
}
}
})
})
</script>
</head>
<body>
<input id="nb" label="NumberBox1:" labelPosition="top">
<button class="easyui-linkbutton" onclick="alert($('#nb').numberbox('getValue'))">GetValue</button>
</body>
</html>
The 'getValue' method returns the value while the 'getText' method returns the displaying text. They are different in some conditions. For example, if you set the 'prefix' property or some other formats, the 'getText' method will return the formatted text that looks like '$23.24', but the 'getValue' method only returns the '23.24' value according to the 'precision' setting.