JS 动态显示 获取下拉框的多个值
<script type="text/javascript">
function GetProcessVal(i, t) {
document.getElementsByName("items[#index#].typeName")[i].value += t.value + ',';
}
</script>
后台代码:
static StringBuilder sbProcessingtype = null;
private void getProcessingtype()
{
if (null == sbProcessingtype)
{
sbProcessingtype= new StringBuilder();
string str_Query = "select comoboxText from Bs_ComboBoxConfig where comoboxID='15' order by comoboxValue asc";
IList<string> list = objComboBoxConfigRepository.ExecuteSQLReturnStr(str_Query);
sbProcessingtype.Append("<select onchange=\"GetProcessVal({0},this)\" name=\"items[#index#].Processingtype\" > <option value=\"\"></option>");
int count = list.Count;
for (int i = ; i < count; i++)
{
sbProcessingtype.Append("<option value=\"" + list[i] + "\">" + list[i] + "</option>");
}
}
}
调用 :
private string BindTable(IList<VOutProceManager> objList, bool isDeleted)
{
sbProcessingtype = null;
getProcessingtype();//调用方法
string strCalMethod = "";
StringBuilder sb = new StringBuilder();
int i = ;
string currentdate = DateTime.Now.ToString("yyyy-MM-dd");
string PriceType = Convert.ToString(base.GetComboBoxConfig());
foreach (VOutProceManager obj in objList)
{
sb.Append("<tr class=\"unitBox\">");
if (isDeleted)
sb.Append("<td style='width:30px' ><a class='btnDel' style='width:22px' target=\"ajaxTodo\" style=\"cursor:pointer\" href=\"outProcessGL/OProcessRequisition/DelMaterialInfo?id=" + obj.Id + "&iscoper=" + obj.Isbom + "\" >删除</a></td>");
else
sb.Append("");
sb.Append("<input type=\"hidden\" name=\"items[#index#].Id\" submitName=\"items[" + i + "].Id\" value=\"" + obj.Id + "\" /> ");
sb.Append("<input type=\"hidden\" name=\"items[#index#].bomID\" submitName=\"items[" + i + "].bomID\" value=\"" + obj.bomID + "\" /> ");
sb.Append("<input type=\"hidden\" name=\"items[#index#].Isbom\" submitName=\"items[" + i + "].Isbom\" value=\"" + obj.Isbom + "\" /> ");
sb.Append("<td ><input class=\"textInput \" size='15' readonly=\"readonly\" value=\"" + obj.mouldNo + "\" > </td>");
sb.Append("<td ><input class=\"textInput \" size='9' readonly=\"readonly\" name=\"items[#index#].partName\" submitName=\"items[" + i + "].partName\" value=\"" + obj.partName + "\" > </td>");
sb.Append("<td ><input class=\"textInput \" size='3' readonly=\"readonly\" name=\"items[#index#].drawingNo\" submitName=\"items[" + i + "].drawingNo\" value=\"" + obj.drawingNo + "\" > </td>");
sb.Append("<td ><input class=\"textInput required number\" size='9' name=\"items[#index#].qty\" submitName=\"items[" + i + "].qty\" value=\"" + obj.qty + "\" > </td>");
sb.Append("<td ><input class=\" textInput \" size='15' name=\"items[#index#].typeName\" submitName=\"items[" + i + "].typeName\" value=\"" + obj.typeName + "\" > ");
sb.Append(string.Format(sbProcessingtype.ToString(), i) + " </td>");//调用sbProessingType
sb.Append("</tr>");
i++;
}
return sb.ToString();
}
JS 动态显示 获取下拉框的多个值的更多相关文章
- Js获取下拉框选定项的值和文本
Js获取下拉框的值和文本网上提供了2种方法:但有些人很不负责任,他们根本没考虑到浏览器之间的差异导致的错误,导致很多新手琢磨了半天找不出错误! 下面我总结下Firefox和IE下获取下拉框选定项的值和 ...
- js,jquery获取下拉框选中的option
js获取select选中的值: var sel=document.getElementById("select1"); var index = sel.selectedIndex; ...
- 利用js取到下拉框中选择的值
现在的需求是:下拉框中要是选择加盟商让其继续选择学校,要是选择平台管理员则不需要选择学校.隐藏选择下拉列表. 选择枚举值: /// <summary> /// 平台角色 /// </ ...
- js获取下拉框当前选中的值并弹出
this.options[this.selectedIndex].value --- 显示文本 this.value --- 实际存储值 调用实例: <script language=" ...
- 获取下拉框的value和值
jsp: <td class="formItem_content"> <select name="label" id = "labe ...
- jquery获取下拉框中的循环值
<select class="test" id="projectno" name="projectno"> <option ...
- 用js 实现代码获取下拉框的value值
var rtl=document.getElementById("selpartyorg"); //获取下拉框对象 var id=rtl.options[rtl.selectedI ...
- 原生js获取下拉框下标
// 获取下拉框所选下标 传入下拉框的id function getselectscheckitemindex (idStr) { let o = document.getElementById(id ...
- 【jQuery获取下拉框select、单选框radio、input普通框的值和checkbox选中的个数】
radio单选框:name属性相同 <input type="radio" id="sp_type" name="p_type" va ...
随机推荐
- Python调用C模块以及性能分析
一.c,ctypes和python的数据类型的对应关系 ctypes type ctype Python type c_char char 1-character string c_wchar wch ...
- Beaglebone Back学习六(Can总线测试)
Can总线测试 1 Can总线 控制器局域网 (Controller Area Network, 简称 CAN 或 CANbus)是一种通信协议,其特点是允许网络上的设备直接互相通信,网络上不需要主机 ...
- console.log的使用
相比alert他的优点是: 他能看到结构话的东西,如果是alert,淡出一个对象就是[object object],但是console能看到对象的内容. console不会打断你页面的操作,如果用al ...
- InnoDB外键使用小结
USE `wfc_database`; # 主表(也可以称作:被参照表.referenced table.outTable) ALTER TABLE `app` ENGINE=INNODB; # 从表 ...
- Jquery实现自动提示下拉框
1.引入脚本库: <script type="text/javascript" src="/Jscripts/jquery-1.3.2.js"&g ...
- [转载]C#对象序列化与反序列化
文章写的实在是太好了,忍不住转来: http://www.cnblogs.com/LiZhiW/p/3622365.html#_Toc8478 1.对象序列化的介绍 (1).NET支持对象序列化的几种 ...
- 严重: The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it.
今日在重新部署项目时出现此问题,虽然对项目无影响,但问题就是问题.完整信息如下(使用idea工具): 十二月 05, 2015 11:44:27 上午 org.apache.catalina.star ...
- office安装不了 “windows installer 服务不能更新一个或多个受保护的windows文件”
出现这种情况可能是系统中某些文件缺失了,一般发生于安装GHOST版或做过精简的系统 打开C:\WINDOWS\msagent 看看文件夹中内容是不是如下图所示: 再打开C:\Program Files ...
- js的面向对象的程序设计之理解继承
来自<javascript高级程序设计 第三版:作者Nicholas C. Zakas>的学习笔记(六) 先来解析下标题——对象和继承~ 一.对象篇 ECMA-262把对象的定义为:&qu ...
- [转载]OpenFileDialog对话框Filter属性
首先说明一个示例,分析一下Filter属性的构成:“ Excel文件|*.xls ”,前面的“Excel文件”成为标签,是一个可读的字符串,可以自定定义,“|*.xls”是筛选器,表示筛选文件夹中后缀 ...