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 urllib2 模块学习笔记
2015.3.6 urllib2的使用方法大致如下 # 定制Handler处理函数 opener = urllib2.build_opener(ProxyHandler, HTTPHandler) ...
- Hello World 的makefile模板及其分析
makefile模板: ifeq ($(KERNELRELEASE),) //判断KERNELRELEASE是否为空,只有执行make的当前目录为内核源代码目录时,该变量才不为空. KERNELDIR ...
- Homebrew下安装Cocoapods
在Mavericks下安装Cocoapods遇到ruby安装问题,参照以下网址圆满解决问题. http://www.moncefbelyamani.com/how-to-install-xcode-h ...
- Linux学习系列之Linux入门(一)linux安装与入门
第一篇:安装并配置Linux开发环境 一.安装linux: 主要安装Linux的发行版,到目前为之,主要的发行版有: 比较常用的是Ubuntu.redhat和centOS,主要的安装方法详细: Ubu ...
- [译] ASP.NET 生命周期 – ASP.NET 请求生命周期(三)
使用特殊方法处理请求生命周期事件 为了在全局应用类中处理这些事件,我们会创建一个名称以 Application_ 开头,以事件名称结尾的方法,比如 Application_BeginRequest.举 ...
- aaaa
http://www.host.com http://www.host.com http://sz.weixun.com/scenery/details-3.htm http://sz.weixun. ...
- IOS调用相机相册
#import "SendViewController.h" //只能打开,没有加载图片的代码,老代码,供参考 #import <MobileCoreServices/UT ...
- 去除C/C++程序代码中的注释
最近搞软件著作权,去除代码空行和注释比较麻烦,想写个程序自动去除,去网上搜了下,发现有类似的程序,不过只有去除注释.鉴于word中可以去除空行(用^p^p替换^p),先用网上的代码,以后有时间写个完整 ...
- 3123 高精度练习之超大整数乘法 - Wikioi
题目描述 Description 给出两个正整数A和B,计算A*B的值.保证A和B的位数不超过100000位. 输入描述 Input Description 读入两个用空格隔开的正整数 输出描述 Ou ...
- 解决eclipse复制粘贴js代码卡死的问题
鸣谢:http://blog.csdn.net/zhangzikui/article/details/24805935 ---------------------------------------- ...