Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 2604

Use it for questions about JavaScript/PHP code to create asynchronous web applications.

10
votes
disabled: you will have to use another module or some kind of configuration. The exact way depends on the origin of the JavaScript code that makes the Ajax petitions. …
answered May 6 '14 by sanzante
3
votes
You can't do that directly. Instead, use a function that calls the two other functions. '#ajax' => array( 'callback' => 'my_callbacks_wrapper', ) ... Then: my_callbacks_wrapper($form …
answered Aug 8 '14 by sanzante
0
votes
This seems an error in Commerce Coupon Percentage module. Your problem comes from the EntityMetadataWrapperException: when processing the AJAx petition something goes wrong and an Exception is throw …
answered Jun 19 '14 by sanzante
13
votes
You can render the status messages and send them as anohter AJAX command. For example: $commands = array(); // Add other commands $commands[] = ajax_command_prepend('div#ajax-status-messages … -wrapper', theme('status_messages')); return array('#type' => 'ajax', '#commands' => $commands); At least this is the way I solved this problem when I faced it. …
answered Nov 29 '12 by sanzante
0
votes
Thus topic has its own issue in the module's issue queue: Need to get the redirect message of successful webform submission via ajax with ajax_disable_redirect.module There's a patch but nobody tested it. Maintainer is waitinig for some confirmation. If you need it go for it. …
answered May 16 '16 by sanzante
1
vote
All Drupal behaviors are called when an AJAX call is performed. This allows modules to attach its 'behaviors' to new loaded content. There are much cases where the behavior should be attached just …
answered Jun 12 '14 by sanzante
1
vote
A form[#redirect] will not work in an AJAX form. You can use an AJAX redirect command from CTools: ctools_ajax_command_redirect To do this, you should probably have to alter the form and use your … own callback function returning the ajax command (along other needed data). I don't know advanced form block module so I can't say how difficult it is. Example from http://dropbucket.org/node/1236 …
answered Aug 13 '14 by sanzante
1
vote
The workflow in an AJAX callback with a non button element is: Submit data is received, form is constructed and validated. If no validation errors are detected form is rebuilt. This means that the … form function is called again (the form that returns the form structure). AJAX callback function is called. The task of this function is only to return the data to the browser. No persistent …
answered Mar 17 '15 by sanzante
0
votes
The problem is the element's name: submit. In the rendered page there's another form that have the same button name (submit), so the AJAX layer just ofund one of the buttons but not the two. To fix … this just rename the element's name: $form['myform-submit'] = array( '#type' => 'submit', '#value' => t('Send Message'), '#ajax' => array( 'wrapper' => 'myform-wrp', 'callback' => 'myform_ajax_callback', ), ); …
answered Jun 3 '14 by sanzante
0
votes
In your form an AJAX call is made when your car_brand element is changed but also when upload image button is clicked. Your problem is the AJAX call that is made when upload button is clicked. In … the element that fired the AJAX call modifying the select element options only when your first select (brands). You can check for that element in the $form_state['triggering_element']. …
answered Mar 18 '15 by sanzante
0
votes
AJAX Commands are supposed to be returned in the callback function, not printed. Also, you have to give a CSS valid selector. Try this: function _change_table_product_type(&$form,&$form_state … -' . $product_type, 'show'); return array('#type' => 'ajax', '#commands' => $commands); } You can show the actual selector that code generates and test it in the JavaScript console. Just type: jQuery('CSS_SELECTOR').show(); If element is shown your CSS selector code is right. …
answered Apr 13 '15 by sanzante
2
votes
You dont' have to call drupal_get_form explicitly, instead mark form to rebuild. In your ajax powerd element define two attributes: #submit, and #ajax. #submit references the function that makes … the action related to the submission (in your case changing the step value to 2 in form state). Also, set $form_state['rebuild'] to TRUE. #ajax, where you set the ajax parameters and the PHP function …
answered Dec 9 '13 by sanzante
2
votes
After an AJAX submit by a select or some similar not submit element the Form API rebuilds de form if no validate errors are found. See drupal_process_form() where this is stated in the inline … comments: // However, for forms that have not been fully executed (e.g., Ajax // submissions triggered by non-buttons), there is no submit handler to set // $form_state['rebuild']. It would not make …
answered Mar 30 '15 by sanzante