<form name='test' id='test'> <input type='checkbox' id='filter_1' value='1'><label for='filter_1'>Test me</label> <div> {{=LOAD('chart','test.load',ajax=True, target='test_div', )}} </div>
<button id='try' type='button'>Test this out</button>
<script> $('#try').click(function(){ jQuery('#test_div').get(0).reload() }); </script></form>
def test(): print request.vars ....
Sorry i'm not clear! I'm trying to break up a reporting site and my initial idea was to use several LOAD components where in the past i was using ajax calls. I like the component framework as it seems i can return HTML templates... it just feels cleaner.I have this component within the form, but i could keep all the components outside the form if that is required to have them passed to their corresponding controller.Another quick question on components. Is there a way to wait for them to be loaded until called upon or must they be all loaded on the initial page load?
<div id='mycomponent'></div>
$.web2py.component('{{=URL('controller', 'function.load')}}', 'mycomponent');
jQuery('#test_div').get(0).reload()
data-w2p_target="..."
var jqxhr = $.post(baseUrl() + "default/test", $('form').serialize()) .done(function(data) {
..... })