思路:在easyui的输入框上定义隐藏框,然后根据隐藏框的值延迟设定easyui的输入框的placeholder
<table class="table" style="width: 100%;">
<tr>
<th>最小值(¥)>=</th>
<td>
<s:hidden id="message1" value="大于等于下限" theme="simple"/>
<s:textfield name="object.moneyLower" theme="simple" cssClass="easyui-numberbox" data-options="required:true,placeholder:333" />
</td>
</tr>
<tr>
<th>最大值(¥)<=</th>
<td>
<s:hidden id="message2" value="小于等于上限" theme="simple"/>
<s:textfield name="object.moneyUpper" theme="simple" cssClass="easyui-numberbox" data-options="required:true" />
</td>
</tr>
</table>
JS:
$(function() {
window.onload = numberInputPlaceholder();
});
/**
* 定义提示框的显示
*/
function numberInputPlaceholder(){
setTimeout(function(){
$(".easyui-numberbox").each(function(i){
var messageInput = $(this).prev('input');
var messageVal = messageInput.val();
var targetInput =this;
if(targetInput){
$(targetInput).attr("placeholder", messageVal);
}
});
},10);
}
效果图: