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 ...
随机推荐
- 《C和指针》 读书笔记 -- 第11章 动态内存分配
1.C函数库提供了两个函数,malloc和free,分别用于执行动态内存分配和释放,这些函数维护一个可用内存池. void *malloc(size_t size);//返回指向分配的内存块起始位置的 ...
- cwm-recovery自动生成工具
android发展迅速,刷机已经成了一种习惯,cwm-recovery是必不可少的工具,下面我把自己用的自动生成cwm-recovery的工具发布出来,供友友们交流和学习,欢迎拍砖 已经公开发布在gi ...
- The method of type must override a superclass method
导入android项目时,报The method of type must override asuperclass method 一堆错误, 解决方法: 将编译的jdk与使用的jdk版本一致即可.
- Oracle表连接
一个普通的语句select * from t1, t2 where t1.id = t2.id and t1.name = 'a'; 这个语句在什么情况下最高效? 表连接分类: 1. 嵌套循环连接(N ...
- NSTImer重复执行任务
问题 应用需要调度代码以在特定的时间执行.此外,你还想要重复执行任务. 解决方案 使用NSTimer调度代码以在特定的时间执行.为了使用NSTimer,你需要有日期对象与指向应用的运行循环的引用. 注 ...
- 转载 @html.ActionLink的几种参数格式
一 Html.ActionLink("linkText","actionName") 该重载的第一个参数是该链接要显示的文字,第二个参数是对应的控制器的方法, ...
- First Groovy
class Sample { def names = ["anna", "annie", "tommy", "bobby" ...
- QR code 金庸小说体(二)
传说 在二维码世纪,流传着这样一个传说,long long ago,武林一片混乱,这时魔教二长老创立了一门绝世武功——QR code,随后称霸武林.但同时也遭到武林中人的觊觎和反抗,各大武林正派掌门人 ...
- 1074: [SCOI2007]折纸origami - BZOJ
Description 桌上有一张边界平行于坐标轴的正方形纸片,左下角的坐标为(0,0),右上角的坐标为(100,100).接下来执行n条折纸命令.每条命令用两个不同点P1(x1,y1)和P2(x2, ...
- java中四种引用类型
java中四种引用类型 今天看代码,里面有一个类java.lang.ref.SoftReference把小弟弄神了,试想一下,接触java已经有3年了哇,连lang包下面的类都不了解,怎么混.后来在 ...