I've done quite a bit of reading on this, but I'm still a little vague
about how to achieve what I want. Here's some example code to start
out with:
/**example template code **/
<form onSubmit="return false;">
<?php foreach ($tests as $test): ?>
<?php echo $html->Checkbox('Test/'. $test['Test']['id']); ?>
<?php endforeach; ?>
<?php echo $ajax->submit('Add Data To Div Below', array('url'
=>'ajaxAddTests', 'update'=>'data')); ?>
</form>
<div id="data">
<h1> test data here </h1>
</div>
/** END example template code **/
So basically, in this simplified example, I'm parsing through the
check boxes in the form through the "ajaxAddTest" action. After doing
some work depending on which check boxes were selected, the action
renders the "ajax_add_tests" view to the "data" div directly below the
form. This could be any kind of data, it's not really important.
That part works properly, but it always overwrites the "data" div. I
need it to take what's in the data div and either prepend or append
the new data to it. In simple terms, I'd like it to push the data
down and put the new stuff at the top.
IMPORTANT: The user can push the ajax->submit button many times with
many combinations of checked boxes. Each time, I need it to just push
the data down and never overwrite anything.
I've come up with different solutions to solve the problem, but none
seem very elegant or simple. I'm assuming the easiest solution
would be to grab the existing innerHTML somehow and append it onto the
new data coming in. Another way would be to simply create a new div
each time data is submitted.
Regardless, any help (with code examples) would be greatly
appreciated! I know I'm probably missing something obvious here, so
my apologies if this is an easily solved problem.
- Dustin Weber
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---