Hi Antony,

the workaround
http://forum.jquery.com/topic/submit-event-serialize-and-submit-buttons-get-the-button-name
works
fine - thank you!

2012/7/23 Anthony <abasta...@gmail.com>

> This is not specific to the LOAD() helper but a limitation of the jQuery
> serialize() method used to post form data via Ajax. See
> https://groups.google.com/d/msg/web2py/708hxAdDGKY/2bNwbQVXc04J (includes
> link to possible workaround).
>
> Anthony
>
>
> On Monday, July 23, 2012 3:48:56 PM UTC-4, mweissen wrote:
>>
>> Hi, I have a simple form with two submit-buttons.
>>
>> First try:
>>
>> def index():
>>     form=FORM(
>>         INPUT(_type='submit', _value='A', _name='AA'),
>>         INPUT(_type='submit', _value='B', _name='BB'),
>>     )
>>
>>     if form.accepts(request, session):
>>         return dict(AA=form.vars.AA, BB=form.vars.BB)
>>
>>     return dict(AA=form, BB='')
>>
>>
>> And a simple view index.html
>>
>> AA: {{=AA}}<br />BB: {{=BB}}
>>
>>
>> A click on button A gives
>>
>> AA:A
>> BB:
>>
>>
>>  and a click on B gives
>>
>> AA:
>> BB:B
>>
>>
>> Everything works as expected - I need to know, which submit-button has
>> been pressed.
>>
>> ---------------------------
>>
>> Secondy try:
>>
>> Now I have two other views, index.load like index.html
>>
>> AA: {{=AA}}<br />BB: {{=BB}}
>>
>>
>> and an index2.html
>>
>> {{extend 'layout.html'}}
>> {{=LOAD('default','index.load'**,ajax=True)}}
>>
>>
>> Calling index2.html allows a click on button A and button B, but the
>> values have gone. The result is always
>>
>> AA:
>> BB:
>>
>>
>> It is not possible to decide, which submit button was active.
>> Any ideas?
>>
>> Regard, Martin
>>
>>
>>  --
>
>
>
>

-- 



Reply via email to