jquery - passing span or label to Controller in ASP.NET MVC 3 -


i have script:

 $(this).before('<span type="text" id="id" name="name" class="tag">' + txt + '</span>'); 

but doesn't appear in formcollection, after submit form. assume formcollection contains "<input type=...>" tags. there way can pass <span> or <label> view controller?

no, can pass hidden input:

$(this).before('<input type="hidden" id="id" name="name" value="'+txt+' /><span type="text" id="span_id" name="span_name" class="tag">' + txt + '</span>'); 

this add span element, visible user, , input element hidden user accessible in formcollection


Comments