@Derk,
Thanks for the reference, I built the test app to get a better 
understanding of the way this works, 
it probably solves the form.custom issue I posted here:
https://groups.google.com/forum/?fromgroups#!topic/web2py/3HoDW6ygCDQ

@Anthony,
Thanks for your reply.
 

> In that case, you might consider loading the form as an Ajax component.


That's what I tried after reading about components in the book (before 
giving the
none ajax solution a try)

 <a href="#vCardModal" data-toggle="modal"><img src="{{=URL('static','img/
icons/vCard.png')}}" alt="" width="48px" height="48px" /></a>

<div id="vCardModal" class="modal hide fade">
  {{=LOAD('vcard','mailVcard.load', args=node.id, ajax=True)}}
</div> <!-- /modal -->

As an example I took my implementation of a tab-able timetable, which loads 
the classes of the current day.
However, this way of coding loads the form before the link has been 
clicked. Which results in a form
maintaining its state when switching between showing and dismissing the 
modal window. I thought I'd
solve this adding a reset button: 
reset=INPUT(_id="reset",_class="btn",_type="reset",_value="Reset"),
but that button does not reset the form.

Is there a way to not load the form until the link has been clicked?


Best regards,

Annet





 

> Otherwise, you'll have to explicitly set the action of the form to the URL 
> where you want it to post. By default, the action is simply set to "#", 
> which means it will post to the URL of the current page -- if you want it 
> to post elsewhere, you have to specify the URL where it should post.
>
> Anthony
>
> On Friday, May 17, 2013 2:21:38 PM UTC-4, Annet wrote:
>>
>> Hi Derek,
>>
>> Thanks for you reply. 
>>
>> The key is, you want to submit via ajax, and make sure you do a 'return 
>>> false'. If there is an error in your javascript, you may see the post 
>>> getting sent to the current url or the action setting of the form.
>>>
>>
>> At the moment I have a SQLFORM.factory() form which I return to the view 
>> in a dict. So there's no JavaScript involved yet, is there? What do I have 
>> to do to submit that form via ajax? Could you provide me with an example?
>>
>>
>> Regards,
>>
>> Annet
>>
>

-- 

--- 
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/groups/opt_out.


Reply via email to