很简单的问题,请帮帮忙 不知道难不难,但好象你还在用DELPHI的语言来描述你的问题,所以看不大懂可否把问题点详细描述一下? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这样的我的一个组件框A里放着所有的用户,选择其中一些,放到另一个组件框B中去,然后点"SAVE"按钮,那么回把组件框B的数据放到一张表里去,大概就这个意思,现在的问题是我怎么取到组件框B中每行的值? 正好有个例子,改一下,不知道能不能符合你的要求。<?phpif($post=='true'){ $array = @explode("<zalvsa>",$string); for($i=0;$i<count($array);$i++){ echo $array[$i]."<br>"; }}?><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><script language="JavaScript"><!--function addSrcToDestList() {destList = window.document.forms[0].destList;srcList = window.document.forms[0].srcList;var len = destList.length;for(var i = 0; i < srcList.length; i++) {if ((srcList.options[i] != null) && (srcList.options[i].selected)) {var found = false;for(var count = 0; count < len; count++) {if (destList.options[count] != null) {if (srcList.options[i].text == destList.options[count].text) {found = true;break; } }}if (found != true) {destList.options[len] = new Option(srcList.options[i].text);len++; } } }}function deleteFromDestList() {var destList = window.document.forms[0].destList;var len = destList.options.length;for(var i = (len-1); i >= 0; i--) {if ((destList.options[i] != null) && (destList.options[i].selected == true)) {destList.options[i] = null; } }}function show_value(){ var i = document.forms[0].destList.options.length; var string = ''; for(j=0;j<i;j++){ string +=document.forms[0].destList.options[j].text+'<zalvsa>'; } window.location.href="16.php?string="+string+"&post=true";}// --></SCRIPT></head><body><center><form method="POST"><table bgcolor="#FFFFCC"><tr><td bgcolor="#FFFFCC" width="85"><select size="6" name="srcList" multiple><option value="Item1">Item 1<option value="Item 2">Item 2<option value="Item 3">Item 3<option value="Item 4">Item 4<option value="Item 5">Item 5<option value="Item 6">Item 6</select></td><td bgcolor="#FFFFCC" width="74" align="center"><input type="button" value=" 增加到右边 " onClick="javascript:addSrcToDestList()"><br><br><input type="button" value=" 从右边删除 " onclick="javascript:deleteFromDestList();"></td><td bgcolor="#FFFFCC" width="69"><select size="6" name="destList" multiple></select></td><td><input type='button' value='click me' onclick='show_value()'></tr></table></form></body></html>不过我觉得LZ既然能做到“选择一些放到另外一个组件”,那剩下的没有什么问题啊 长篇大论哦,<select size="6" name="srcList"><option value="good">GOOD</option><option value=""bad" checked>BAD</option></select>看见name没?在PHP中用$srcList就取取了这里默认是$srcList="bad"。至于multiple如何取,在下也想知道,大概是用数组吧。 <script>function getArray(classObj){for(var i=0;i<classObj.length;i++){ alert(classObj[i].value);}}</script><BODY><select id="class1"> <option value="xx">xx</option> <option value="yy">yy</option> <option value="zz">zz</option></select><input type="button" onClick="getArray(class1)" > to axolo(七月十五) ( )长篇大论哦,<select size="6" name="srcList"><option value="good">GOOD</option><option value=""bad" checked>BAD</option></select>看见name没?在PHP中用$srcList就取取了这里默认是$srcList="bad"。至于multiple如何取,在下也想知道,大概是用数组吧。1)“大概”知道偏差是多远吗?2)我的那所谓的“长篇大论”实际上给LZ用的只是前面几句数组的调用语句。之所以都贴出来,是觉得有必要让LZ看整个选择到取值的过程。不知道这位大哥明白了没。当然了肯定有比我更简单的方法,只是暂时我不懂。况且那个JS程序除了取第二个组建的值是我自己写的外,都是一个长智者贴在CSDN上的,我只是搬人家的过来。估计自己写也不会比他简单到哪里去。 TO: axolo(七月十五) :说的这个问题也是我关心的哈,就是我POST 后,发觉只传了一个值, TO: aniude(阿牛的乜乜: 你这样做很好,但我如何把这个数组POST ?也就是提交,?我也搞不明白 TO: zalvsa(水米) : 下面这句话的意思显示出来,我就是搞不明白如何保存,哎,做WEB,当菜鸟,难哦.<?phpif($post=='true'){$array = @explode("<zalvsa>",$string);for($i=0;$i<count($array);$i++){ echo $array[$i]."<br/>";}}?> TO: axolo(七月十五) :说的这个问题也是我关心的哈,就是我POST 后,发觉只传了一个值, TO: aniude(阿牛的乜乜: 你这样做很好,但我如何把这个数组POST ?也就是提交,?我也搞不明白 TO: zalvsa(水米) : 下面这句话的意思显示出来,我就是搞不明白如何保存,哎,做WEB,当菜鸟,难哦.<?phpif($post=='true'){$array = @explode("<zalvsa>",$string);for($i=0;$i<count($array);$i++){ echo $array[$i]."<br/>";}}?> mysql连接数据库经常出错. 求帮忙 php如何判断form的是method="post" 或者get 能上载小文件,为何不能上载大文件?你们一般用什么方法解决上载的? 如何执行程序,并把结果显示在网页上 大家帮帮忙,谢谢 20分没有人支持..我给100分.... sky_blue (老衲) 请进! 我在98下安装了php4,和mysql,可是连接数据库错误,我该怎么办? 求按位异或bcc算法代码 Session 我想把你给撕碎! 这句代码中的变量为什么没有值了?
我的一个组件框A里放着所有的用户,选择其中一些,放到另一个组件框B中去,然后点"SAVE"按钮,那么回把组件框B的数据放到一张表里去,大概就这个意思,
现在的问题是我怎么取到组件框B中每行的值?
<?php
if($post=='true'){
$array = @explode("<zalvsa>",$string);
for($i=0;$i<count($array);$i++){
echo $array[$i]."<br>";
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
function addSrcToDestList() {
destList = window.document.forms[0].destList;
srcList = window.document.forms[0].srcList;
var len = destList.length;
for(var i = 0; i < srcList.length; i++) {
if ((srcList.options[i] != null) && (srcList.options[i].selected)) {var found = false;
for(var count = 0; count < len; count++) {
if (destList.options[count] != null) {
if (srcList.options[i].text == destList.options[count].text) {
found = true;
break;
}
}
}
if (found != true) {
destList.options[len] = new Option(srcList.options[i].text);
len++;
}
}
}
}function deleteFromDestList() {
var destList = window.document.forms[0].destList;
var len = destList.options.length;
for(var i = (len-1); i >= 0; i--) {
if ((destList.options[i] != null) && (destList.options[i].selected == true)) {
destList.options[i] = null;
}
}
}function show_value(){
var i = document.forms[0].destList.options.length;
var string = '';
for(j=0;j<i;j++){
string +=document.forms[0].destList.options[j].text+'<zalvsa>';
}
window.location.href="16.php?string="+string+"&post=true";
}
// -->
</SCRIPT>
</head>
<body>
<center>
<form method="POST">
<table bgcolor="#FFFFCC"><tr>
<td bgcolor="#FFFFCC" width="85">
<select size="6" name="srcList" multiple>
<option value="Item1">Item 1
<option value="Item 2">Item 2
<option value="Item 3">Item 3
<option value="Item 4">Item 4
<option value="Item 5">Item 5
<option value="Item 6">Item 6
</select>
</td>
<td bgcolor="#FFFFCC" width="74" align="center">
<input type="button" value=" 增加到右边 " onClick="javascript:addSrcToDestList()">
<br><br>
<input type="button" value=" 从右边删除 " onclick="javascript:deleteFromDestList();">
</td>
<td bgcolor="#FFFFCC" width="69">
<select size="6" name="destList" multiple>
</select>
</td>
<td><input type='button' value='click me' onclick='show_value()'>
</tr>
</table>
</form>
</body>
</html>不过我觉得LZ既然能做到“选择一些放到另外一个组件”,那剩下的没有什么问题啊
<select size="6" name="srcList">
<option value="good">GOOD</option>
<option value=""bad" checked>BAD</option>
</select>
看见name没?
在PHP中用$srcList就取取了
这里默认是$srcList="bad"。至于multiple如何取,在下也想知道,大概是用数组吧。
function getArray(classObj)
{
for(var i=0;i<classObj.length;i++)
{
alert(classObj[i].value);
}
}
</script>
<BODY>
<select id="class1">
<option value="xx">xx</option>
<option value="yy">yy</option>
<option value="zz">zz</option>
</select>
<input type="button" onClick="getArray(class1)" >
长篇大论哦,
<select size="6" name="srcList">
<option value="good">GOOD</option>
<option value=""bad" checked>BAD</option>
</select>
看见name没?
在PHP中用$srcList就取取了
这里默认是$srcList="bad"。至于multiple如何取,在下也想知道,大概是用数组吧。1)“大概”知道偏差是多远吗?
2)我的那所谓的“长篇大论”实际上给LZ用的只是前面几句数组的调用语句。之所以都贴出来,是觉得有必要让LZ看整个选择到取值的过程。不知道这位大哥明白了没。当然了肯定有比我更简单的方法,只是暂时我不懂。况且那个JS程序除了取第二个组建的值是我自己写的外,都是
一个长智者贴在CSDN上的,我只是搬人家的过来。估计自己写也不会比他简单到哪里去。
TO: aniude(阿牛的乜乜: 你这样做很好,但我如何把这个数组POST ?也就是提交,?我也搞不明白
TO: zalvsa(水米) : 下面这句话的意思显示出来,我就是搞不明白如何保存,哎,做WEB,当菜鸟,难哦.
<?php
if($post=='true'){
$array = @explode("<zalvsa>",$string);
for($i=0;$i<count($array);$i++){
echo $array[$i]."<br/>";
}
}
?>
TO: aniude(阿牛的乜乜: 你这样做很好,但我如何把这个数组POST ?也就是提交,?我也搞不明白
TO: zalvsa(水米) : 下面这句话的意思显示出来,我就是搞不明白如何保存,哎,做WEB,当菜鸟,难哦.
<?php
if($post=='true'){
$array = @explode("<zalvsa>",$string);
for($i=0;$i<count($array);$i++){
echo $array[$i]."<br/>";
}
}
?>