I am creating a php
page for camp registration, very basic and I do not want to plaster the page with multiple Name label/textbox. What I was thinking was to by default have one textbox and one label, and possibly blue text that says add another (or even a button) that when pressed the page will keep the current data but add an additional label and textbox so that more info can be added in. This is how I am capturing the data for 1, could this easily be modified in order to achieve my above outcome?
<td><label for="lblName">Campers Name:</label></td>
<td class="style1"><input type="text" name="txtName"
maxlength="100" size="30"></td>
EDIT
The link ad does nothing when I click it, I am sure it is I am missing the obvious but here is full syntax, what should I alter to make it work?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-beta1/jquery.min.js"></script>
<script type="text/javascript">
$("#newCamper").on('click', function() {
$('#Campers').after(
'<div id="Campers">' +
'<td><label for="lblName">Campers Name: </label></td>' +
'<td class="style1"><input type="text" name="txtName" maxlength="100" size="30"></td>' +
'<a href="#" id="rmCamper"> remove this</a>' +
'</div>'
);
});
$(document).on('click', '#rmCamper', function() {
$(this).closest('#Campers').remove();
});
</script>
</head>
<body>
<div id="Campers">
<td><label for="lblName">Campers Name:</label></td>
<td class="style1"><input type="text" name="txtName" maxlength="100" size="30"></td>
<a href="#" id="newCamper">Add another</a>
</div>
</body>
</html>
EDIT #2
when I go to localhost on my machine and push the Add button it changes the URL to localhost# but no additional fields are added to the page?