我有一个视图,其中一些输入文本要使用jquery添加dynamica,我的意思是所有东西都是funzona,当我在浏览器上添加这些输入和do right按钮时,我看不到添加的输入。
函数addPerson () (
current + +;
StrToAdd var = '<table id="compo" name="compo"' + current +'> <tr> <td> <label for="firstname"' + current +'"> Name </ label> <input id = 'firstname' + current + '"name =" Componenti.Nome_ "' +" "+ current +" "+ '" size = "29" /> </ td> <td> <label for = "lastname"' current + + '"> Name </ label> <input id="lastname''" name="Componenti.Cognome_"' + + + current + current'" size="29" /> </ td>'
StrToAdd + = '<td> <label for="luogonascita"' + current +'"> LuogoNascita </ label> <input id = "luogodinascita' + current + '" name = "Componenti.Luogonascita_"' + "" + current + "" + '"size =" 29 "/> </ td>'
StrToAdd + = '<td> <label for="datanascita"' + current +'"> DataNacita </ label> <input id = "dateOfBirth' + current + '" name = "Componenti.datanascita_"' + current + ' "size =" 29 "/> </ td> </ tr> </ table> '
StrToAdd + = '<script type="text/javascript"> jQuery (function ($) {$("# dateOfBirth' + current + '). mask ("' + mask +'")});</ script > ';
$ ('# Components'). Append (StrToAdd); )
问题是,当我在操作中通过post传递数据时,我去创建教育
var valueProvider= formanagrafica.ToValueProvider();
我发现所有的输入,我只添加了一次,因此有不止一次,给出了逗号分隔的值。,valueProvider,I,我
如何检索一行输入文本的值?希望我的解释是正确的。
发布于 2010-04-02 01:56:41
对于要包含在for集合中的每个元素,都需要具有name属性。如果在不同的元素上有两个相同的名称,则在post时将用逗号分隔这两个值。所有唯一的名称都将具有与其相关联的值。
示例1
<input name="foo" value="hi">
<input name="foo" value="there">FormCollection将有一个名为"foo“的键,值为"hi,there”。
示例2
<input name="foo1" value="hi">
<input name="foo2" value="there">FormCollection有两个键,一个名为"foo1“,值为"hi”,第二个键名为"foo2“,值为"there”。
Javascript问题-
我看到current + +;在你的函数调用的顶部...它被初始化为什么?也许先把它改成current++;,然后为了调试的缘故,让alert(current);来看看递增后的值是什么,以确保它能正常工作。
https://stackoverflow.com/questions/2562463
复制相似问题