This is still not clear. What is in /chart/test.load? Is there a form in
there? If so, just use that and forget the outer form you have created,
which is useless? If not, what form are you trying to submit?
If you want to submit a form via Ajax, then create an Ajax component, and
put the entire form in the component. In that case, the form will be
submitted via Ajax automatically.
Anthony
On Tuesday, December 8, 2015 at 8:16:35 PM UTC-5, Jason Solack wrote:
>
> i'm expecting behave like an ajax call similar to this:
>
> var jqxhr = $.post(baseUrl() + "default/test",
> $('form').serialize())
> .done(function(data) {
> .....
> })
>
> i'm writing a single page application and don't want to submit for the
> form in the tradition sense, i want to pass the form via the ajax call
>
> On Tuesday, December 8, 2015 at 2:28:45 PM UTC-5, Anthony wrote:
>>
>> Why would the form submit because you re-load a component that is
>> *inside* the form? Your form doesn't have a submit button, nor an action
>> or a method, and nothing in your JS code executes a submit. How exactly do
>> you expect it to be submitted? It is not clear what you are trying to
>> achieve.
>>
>> Anthony
>>
>> On Sunday, December 6, 2015 at 8:50:21 PM UTC-5, Jason Solack wrote:
>>>
>>> So in this case i was just wanting to see if the form was submitted when
>>> reloading the component via:
>>>
>>> jQuery('#test_div').get(0).reload()
>>>
>>>
>>> and by printing the request.vars to the terminal i saw that it wasn't.
>>> I will try your method $.web2py.component and see what results
>>>
>>> On Sunday, December 6, 2015 at 8:14:35 PM UTC-5, Anthony wrote:
>>>>
>>>> On Sunday, December 6, 2015 at 7:15:04 PM UTC-5, Jason Solack wrote:
>>>>>
>>>>> 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?
>>>>>
>>>>
>>>> Still not quite clear what you are trying to do with the form (as it
>>>> has no action nor submit button). Anyway, you can always manually load
>>>> and/or reload a component as follows:
>>>>
>>>> First, create a div:
>>>>
>>>> <div id='mycomponent'></div>
>>>>
>>>> Then load a component into the div via:
>>>>
>>>> $.web2py.component('{{=URL('controller', 'function.load')}}',
>>>> 'mycomponent');
>>>>
>>>> Anthony
>>>>
>>>>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.