Closed (works as designed)
Project:
Asaf (ajax submit for any form)
Version:
7.x-1.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2014 at 16:25 UTC
Updated:
10 Jul 2014 at 18:58 UTC
Jump to comment: Most recent
Comments
Comment #1
taldy commentedHello apmsooner,
Please ensure that save button is placed in fisrt level of form structure. Because if it's usual node form their buttons usualy is placed in the 'actions' group. In this case you should use:
article_node_form@actions][saveand
article_node_form@-actions][deleteComment #2
apmsooner commented@taldy,
maybe theres a typo in what you pasted or I'm still not understanding the syntax. My buttons are standard node output like so:
<div id="edit-actions" class="form-actions form-wrapper"><input type="submit" class="form-submit" value="Save" name="op" id="edit-submit"><input type="submit" class="form-submit" value="Preview" name="op" id="edit-preview"><input type="submit" class="form-submit" value="Delete" name="op" id="edit-delete"></div>The example provided in the module help assumes the form is node so I'm confused whats the correct syntax...
Comment #3
taldy commentedHello apmsooner,
Form structure in Drupal is tree-like. And in theory form could contain several buttons with the name 'save' but in different branches of form tree. To split buttons with the same name you should specify whole path to the button in form tree with ][ separator between levels.
In your exact case submit and delete buttons are placed in 'actions' group. So you need the followin code:
article_node_form@actions][submitif you want ajaxify only Save button (in this case submit is a machine-name of Save button), and
article_node_form@-actions][deleteif you want to ajaxify all buttons except Delete button.
It's not so easy to understand real names of buttons and their full paths by looking to the HTML, but you always can print real structure of form and find it there. You can do this by following code in your module/theme:
Maybe in future I should make checkbox like "Show form buttons" which will show all buttons with their full paths like "Show form ids" currently shows form ids.
Comment #4
taldy commentedI forgot to say that you need Devel module for the 'dsm' function. Or use
instead of dsm($form). But dsm() is much more useful way for the big structures.
Comment #5
apmsooner commentedThere we go. Got it to work now with your example. You might want to update the documentation on the module page as well as the help text displayed in the ui screen as the node form example won't work unless doing it this way.