I'm using cake & have a web form for entering URLs to go into my db. There will be one input space (url1) and below that a link that says "add another URL" which, when clicked, generates a new form (url2) and reuses the "add another URL". So it would be like:
echo $form->input('name');
echo $form->input('id');
echo $form->input('url1');
echo $form->input('weight1');
echo '<a href="XXX">add another URL</a>';
and then, if XXX is clicked it would be like this:
echo $form->input('name');
echo $form->input('id');
echo $form->input('url1');
echo $form->input('weight1');
echo $form->input('url2');
echo $form->input('weight2');
echo '<a href="XXX">add another URL</a>';
Is there a jquery script I can use to do this or does cake have something built in?