Appending a child in Cake
Posted
by pg
on Stack Overflow
See other posts from Stack Overflow
or by pg
Published on 2010-03-19T23:39:25Z
Indexed on
2010/03/19
23:41 UTC
Read the original article
Hit count: 369
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?
© Stack Overflow or respective owner