呵呵,为什么要这样写呀?这不符合HTML的规范呀。
解决方案 »
- javascript与后台代码交互问题
- 用js能获取客户端的IP地址吗?如果能,怎样实现?
- 【分享】jQuery视频
- 奇怪的onhashchange事件,求助
- ajax传递多个值到js页面
- js引用的问题
- select控件如何根据某text中的值,动态选中其中的值?
- 问一个弱弱的问题,急,在线等
- IE的主页被改了,现在不能使用空白页了,怎么办啊?
- 用div做输入框,如何限制输入的纯文本字数
- 返回值的问题!在线等待
- Finding the below technology for long time,But not.Can you help me? if can ,i will give you 20 scores.
<input type=radio value=abc id=mxh>
<input type=radio value=abc onclick="if (this.checked==false) this.checked=true; else this.checked=false;" checked>
<script>
document.all.mxh.checked=true"
</script>
<script>
document.all.mxh.checked=true
</script>
因為到目前為止我碰到類似情況都是這樣處理
<%do while rs_user.eof %>
<script>
if (a.value=='<%=rs_user("id")%>')document.write('<option value="a" selected>1</option>')
else{document.write('<option value="a">1</option>')}
</script>
......
這樣來寫﹐覺得總是這樣判斷非常不爽﹐因為有時并不是從數據庫讀資料﹐而是定義一個數組﹐又或者只有兩三行﹐所以想問問各位有什么好方法
因此我希望能實現成
<option value="a" javascript:if (a.value=='<%=rs_user("id")%>')write("selected")>
當然這種語法是錯的﹐大家不用糾正﹐只是想表達意思而已按 net_lover(孟子E章) 的做法其實還是如我開始所說的在標識外實現﹐如果有多個<input type=checkbox>怎么辦﹐如果每個都給個id那太煩了吧
<option value="a"
<%if rs_user("id")="a" then response.write(" selected ")%>
>1</option>
..........
这种写法?<input type=checkbox value="t" <%if rs_user("id")="t" then response.write("checked")%>><option value="a" <%if rs_user("id")="a" then response.write("selected")%>>1</option>
把判断放到服务器上吧<option value="a" <%if ("a"==rs_user("id")) Resoponse.Write("selected")%>别说我写的不对啊,既然你在<option里写出了value=a就说明,你是预先知道了这个a ,这样这么写不错的吧