用户操作
[即时聊天] [发私信] [加为好友]
ROC(鹏)ID:chjpeng
14517次访问,排名8468(1),好友0人,关注者1人。
chjpeng的文章
原创 5 篇
翻译 0 篇
转载 8 篇
评论 5 篇
ROC(鹏)的公告

E-mail: chjpeng@163.com
MSN: chjpeng963@hotmail.com
最近评论
xgh815:汉字简繁转换之我见


汉语有两种书面形式:中华人民共和国和新加坡使用的简体中文,和台湾,香港,澳门以及大多数海外华人使用的繁体中文。但是存在一种常见的误解,认为相互转换只需要从一个字符集对应到另一个字符集就可以了,例如从国标码(GB2312)转换到大五码(Big5)。虽然很多代码转换工具实现了简繁汉字一一对应转换,但事实上不是这么简单,简繁汉字并不全是一一对应……
jaydawson:您好,我是个MySQL新手,我在使用COPY表结构的语句的时候,怎么SQL 总是提示Undeclared variable test; 我先create table test(id int(3)); create table a_test(name varchar(20),role varchar(20)); 后,select * into test from a_te……
ljs1519:谢谢,收藏!
handsometong:不错,感谢!!
文章分类
收藏
相册
圖片集
Blog链接
我的鏈接
DonkEr'sBlog
roc@博客园
天蚕再变
鹏翔BLOG
存档
软件项目交易
订阅我的博客
XML聚合  FeedSky
订阅到鲜果
订阅到Google
订阅到抓虾
订阅到BlogLines
订阅到Yahoo
订阅到GouGou
订阅到飞鸽
订阅到Rojo
订阅到newsgator
订阅到netvibes

原创 针对select写了一个通用的option输出函数收藏

新一篇: 动态控制输入项目表数量 | 旧一篇: 在iframe中使用带iframe的日历组件

'author:chjpeng

'email:chjpeng@163.com

function writeSlt(arrstr,arrstrValue,selectedstr)
'arrstr 要显示在option里面的值,arrstrValue option的实际值,selectedstr要选中的默认值
'将一个字串分割为数组,输出select的option,并选中selectedstr arrstr&arrstrValue长度要一致
arr=split(arrstr,",")
arrValue=split(arrstrValue,",")
j=0
do while j<=ubound(arr)
 if trim(arrValue(j))=trim(selectedstr) then
  response.write "<option value='" & arrValue(j) & "' selected>" & arr(j) & "</option>"
 else
  response.write "<option value='" & arrValue(j) & "'>" & arr(j) & "</option>"
 end if
 j=j+1
loop
end function

可以从数据库中读出数据,形成逗开分隔的字符串,来动态生成select的<option>

function getArrString(table,fld,cond,sortfld)
'获取一个指定表中指定字段指字条件的数据,返回一个以逗号分隔的字符串
set rs=server.createobject("adodb.recordset")
sql="select " & fld & " from " & table
if len(cond)>0 then
 sql=sql & " where " & cond
end if
if len(sortfld)>0 then
 sql=sql & " order by " & sortfld
end if
rs.Open sql,conn,1,1
if not (rs.bof or rs.EOF) then
 do while not rs.EOF
  getArrString=getArrString & trim(rs(fld)) & ","
  rs.MoveNext
 loop
end if
getArrString=left(getArrString,len(getArrString)-1)
rs.Close
set rs=nothing
end function

发表于 @ 2005年04月22日 21:51:00|评论(loading...)|编辑

新一篇: 动态控制输入项目表数量 | 旧一篇: 在iframe中使用带iframe的日历组件

评论:没有评论。

发表评论  


当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
Csdn Blog version 3.1a
Copyright © ROC(鹏)