请问数据岛中的字段内容如何放入checkbox的value属性中[在线等]

「已注销」 2003-10-08 07:43:17

我用数据岛构造表格如下:

<table datasrc="#DocList" >
<thead>
</thead>
<tbody>
<tr bgcolor="#F5F5F5">
<td nowrap >
<input type="checkbox" Name="tSelect" value="我想让它等于Name字段,可是怎么都实现不了啊!"></td>
<td nowrap ><span datafld="Name" ><span></a></td>
<td nowrap><span datafld="SentiMent"></span></td>
<td nowrap ><span datafld="RegTime"></span></td>
<td nowrap ><span datafld="Points"></span></td>
<td nowrap ><span datafld="Property"></span></td>
</tr>
</tbody>
</table>
使用数据岛的时候 在<table>里 如果指定了表格的datasrc 那么 <span datafld="xx"></span> 可以方便的读取数据 共享表格的数据源
而我想把字段内容放入 input type=checkbox的value属性中 发现简直不可能实现
而如果如下:
<input type="checkbox" Name="tSelect" datasrc="#DocList" datafld="Name"/>
就不受表格约束了 它有独立的数据源了

我着急啊 望大虾们不吝赐教 刚学XML 还请多多照顾
...全文
122 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
「已注销」 2003-10-08
  • 打赏
  • 举报
回复
孟子告诉了我 我的设想是不可行的

所以我给他分分分

>_<
孟子E章 2003-10-08
  • 打赏
  • 举报
回复
可以用脚本实现

<HTML><HEAD><TITLE></TITLE></HEAD>
<BODY onload="a()">
<div id=m></div>
<XML ID="xmlMeetings">
<?xml version="1.0" ?>
<meetings>
<meeting>
<date>1/1/99</date>
<time>9:00</time>
<location>104号房间</location>
</meeting>
<meeting>
<date></date>
<time>13:00</time>
<location>34号房间</location>
</meeting>
</meetings>
</XML>
<script>
function a()
{
var v=""
var x = document.all.xmlMeetings.XMLDocument
var s = x.selectNodes("/meetings/meeting/location")
for(i=0;i<s.length;i++)
v+="<input type='checkbox' onclick='alert(this.value)' name=xxx value='"+s[i].text+"'><br>"
document.all.m.innerHTML=v
}
</script>
</BODY>
</HTML>

孟子E章 2003-10-08
  • 打赏
  • 举报
回复
CHECKBOX
Although check boxes allow a value attribute that is used when submitting an HTML form on a page, Internet Explorer 4.0 MSHTML uses check boxes as simple Boolean selections. Check boxes generate the Boolean values true or false depending on whether they are checked or not. The binding agent coerces the values to and from the underlying data set. The following coercions are supported, based on the type of the bound column.

The following table describes the values that a bound check box expects a DSO to supply for various data types.

Data type Expected True value Expected False value
String "True" | "1" | <nonempty string> "False" | "0" | <zerolength string>
Integer nonzero 0
Float nonzero 0
Date invalid invalid
Currency nonzero 0

The following is an example of a bound check box.


http://msdn.microsoft.com/workshop/author/databind/dataconsumer.asp?frame=true
孟子E章 2003-10-08
  • 打赏
  • 举报
回复
checkbox只能绑定是否是checked
<HTML><HEAD><TITLE></TITLE></HEAD>
<BODY>
<XML ID="xmlMeetings">
<?xml version="1.0" ?>
<meetings>
<meeting>
<date>1/1/99</date>
<time>9:00</time>
<location>104号房间</location>
</meeting>
<meeting>
<date></date>
<time>13:00</time>
<location>34号房间</location>
</meeting>
</meetings>
</XML>
<table datasrc="#xmlMeetings">
<tr>
<td><input type="checkbox" onclick="alert(this.value)" datafld="date"></div></td>
<td><input type="text" onclick="alert(this.value)" datafld="time"></td>
<td><input type="radio" name=a onclick="alert(this.value)" datafld="location"></td>
</tr>
</table>
</BODY>
</HTML>

「已注销」 2003-10-08
  • 打赏
  • 举报
回复
如果哪位大虾能引经据点告诉我 我的设想是不可行的

我立马结贴 去写XSL

@_@
kingdomzhf 2003-10-08
  • 打赏
  • 举报
回复
checkbox能这样吗?
好象不行吧?

8,909

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧