2013年12月26日 星期四

html-combo-template html-select-templage combo-color combo-css

    select{
        margin:40px;
        background: yellow;
        color:#000;
        text-shadow:0 1px 0 rgba(0,0,0,0.4);
    }
    option:not(:checked) {
        background-color: #FFF;
    }



<label for="com" > Login ID (email)</label>
<select name="userRoleUserID" id="userRoleUserID" onchange="alert(this.value);">
</select>



$.ajaxSetup({ async: false });


var obj_field=document.getElementById('userRoleUserID');
obj_field.options[0] = new Option('','');
s='tableRead?table=USER&fields=RECORDID,LOGIN_ID&where=where db:`<%=bean.getDatabase()%>` &format=S,S&callback=?&db=erp'
$.getJSON(s,
function(data) {
if (data[0]){
for (r=0 ; r<data.length; r++)
{
$(obj_field).append($('<option></option>').val(data[r][0]).html(data[r][1]));
}
}
}
)

沒有留言:

張貼留言