2008年9月25日 星期四

如何寫入 image 到 Sybase

首先必須開一個二位元的欄位,ex:binary,varbinary,image,bit
以下是寫入的範例: 但是在讀出圖檔時,無法直接在網頁直接讀出,必須要特別處理,如下: 而image.php的內容如下:

2008年9月8日 星期一

jQuery - checkbox, radio, select

獲取一組radio被選中項的值
var item = $('input[@name=items][@checked]').val();
獲取select被選中項的文本
var item = $("select[@name=items] option[@selected]").text();
select下拉框的第二個元素為當前選中值
$('#select_id')[0].selectedIndex = 1;
radio單選組的第二個元素為當前選中值
$('input[@name=items]').get(1).checked = true;

獲取值:

文本框,文本區域:$("#txt").attr("value");
多選框checkbox:$("#checkbox_id").attr("value");
單選組radio: $("input[@type=radio][@checked]").val();
下拉框select: $('#sel').val();

控制表單元素:
文本框,文本區域:$("#txt").attr("value",'');//清空內容
$("#txt").attr("value",'11');//填充內容

多選框checkbox: $("#chk1").attr("checked",'');//不打勾
$("#chk2").attr("checked",true);//打勾
if($("#chk1").attr('checked')==undefined) //判斷是否已經打勾

單選組radio: $("input[@type=radio]").attr("checked",'2');//設置value=2的項目為當前選中項
下拉框select: $("#sel").attr("value",'-sel3');//設置value=-sel3的項目為當前選中項
$("11112222").appendTo("#sel")//添加下拉框的option
$("#sel").empty();//清空下拉框