<div dir="ltr">Most browsers have functionality for web development that allows you to examine a page, view the generated markup, and so on. In FireFox, for example, it's under Tools > Web Developer > Inspector, or in Chrome, it's under View > Developer > Developer Tools. You can zero in on the form and the elements generated by this bit of javascript to find out the input names.</div><div class="gmail_extra"><br><div class="gmail_quote">On 9 October 2015 at 14:32, Richard Reina <span dir="ltr"><<a href="mailto:gatorreina@gmail.com" target="_blank">gatorreina@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">2015-10-09 16:12 GMT-05:00 Christian Huldt <span dir="ltr"><<a href="mailto:christian@solvare.se" target="_blank">christian@solvare.se</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">To me, that seems to be able to add several tags with the same id - I<br>
think that is harmful...<br>
<div><div><br>
Den 2015-10-09 kl. 23:02, skrev Richard Reina:<br>
> I have a input tag in a form:<br>
><br>
> <div class="col-xs-4 col-md-4"><br>
> <div id="p_scents"><br>
> <p><br>
> <label for="p_scnts"><input type="text" id="p_scnt" size="20" name="p_scnt" value="" placeholder="email address" /></label><br>
> </p><br>
> </div><br>
> </div><br>
><br>
><br>
> Which gets it's name from the JS function below. However, that name I can't figure out. I have tried<br>
> p_scnt_1 but it comes back undefined. Any ideas what the param name would be for each sequentially added item?<br>
> Here's a working example of the form: <a href="http://jsfiddle.net/jaredwilli/tzpg4/4/" rel="noreferrer" target="_blank">http://jsfiddle.net/jaredwilli/tzpg4/4/</a><br>
><br>
><br>
> $(function() {<br>
> var scntDiv = $('#p_scents');<br>
> var i = $('#p_scents p').size() + 1;<br>
><br>
> $('#addScnt').live('click', function() {<br>
> $('<p><label for="p_scnts"><input type="text" id="p_scnt" size="20" name="p_scnt_' + i +'" value="" placeholder="Input Value" /></label> <a href="#" id="remScnt">Remove</a></p>').appendTo(scntDiv);<br>
> i++;<br>
> return false;<br>
> });<br>
><br>
> $('#remScnt').live('click', function() {<br>
> if( i > 2 ) {<br>
> $(this).parents('p').remove();<br>
> i--;<br>
> }<br>
> return false;<br>
> });<br>
> });<br>
<br>
</div></div></blockquote><div><br></div></div></div><div>I don't think it adds the tags with the same name because when I test the params the first p_scnt comes through as the first value added. If the tags were being added with the same name I would think that either 1) they would be string with both values or 2) the last input would override the previous input. Since param('p_scnt') equals the first value entered neither of those outcomes are occurring. <br></div></div></div></div>
<br>_______________________________________________<br>
dancer-users mailing list<br>
<a href="mailto:dancer-users@dancer.pm">dancer-users@dancer.pm</a><br>
<a href="http://lists.preshweb.co.uk/mailman/listinfo/dancer-users" rel="noreferrer" target="_blank">http://lists.preshweb.co.uk/mailman/listinfo/dancer-users</a><br>
<br></blockquote></div><br></div>