Question
Ajax : add content like form fields or comple form or list... to an existing list
Hi
Let's imagine I have a list of attribues in a form and I want to add a new one, how can I do without refreshing the page ?
image of what I mean : http://img126.imageshack.us/img126/872/addoptionui4.gif
In this example (Magento), the button "Add Option" adds a new line of fields ready to be completed.
I know how to replace the whole content of a cfdiv by something else (ColdFusion.navigate + div id) but it's not very simple and it works fine if I really need to (an can) refresh the cfdiv. But what would be nice is to "add" some new contents to an existing content. For example if I have a div with lots of <cfinput type="text" ...> I would like to add more cfinputs to at the end of the div before the </cfdiv>)
Another scenario (example on the wishlistr.com website http://img249.imageshack.us/img249/2618/addelementue5.gif ) :
I have a list of existing data (a list of products for example), I have a form at the end of the list to add a new product. How can I make the list on the top to have one more element (without refreshing the page, and if possible the rest of list).
It's quite the same thing as above : if my products are in a div each in betwean <li></li>, I want to add a new sort of <li></li> when I click on the "add" button.
I hope I'm clear enough, let me know...
Let's imagine I have a list of attribues in a form and I want to add a new one, how can I do without refreshing the page ?
image of what I mean : http://img126.imageshack.us/img126/872/addoptionui4.gif
In this example (Magento), the button "Add Option" adds a new line of fields ready to be completed.
I know how to replace the whole content of a cfdiv by something else (ColdFusion.navigate + div id) but it's not very simple and it works fine if I really need to (an can) refresh the cfdiv. But what would be nice is to "add" some new contents to an existing content. For example if I have a div with lots of <cfinput type="text" ...> I would like to add more cfinputs to at the end of the div before the </cfdiv>)
Another scenario (example on the wishlistr.com website http://img249.imageshack.us/img249/2618/addelementue5.gif ) :
I have a list of existing data (a list of products for example), I have a form at the end of the list to add a new product. How can I make the list on the top to have one more element (without refreshing the page, and if possible the rest of list).
It's quite the same thing as above : if my products are in a div each in betwean <li></li>, I want to add a new sort of <li></li> when I click on the "add" button.
I hope I'm clear enough, let me know...
