Skip to main content

Timeline for Form API AJAX refreshes page

Current License: CC BY-SA 3.0

12 events
when toggle format what by license comment
Dec 16, 2011 at 3:11 comment added starsinmypockets ['#ajax']['callback'] refers to a callback in your module, not to a hook_menu implementation
Dec 15, 2011 at 19:08 comment added amateur barista Good. I'm curious though, is your PHP function getting called?
Dec 14, 2011 at 22:35 comment added Malks #ajax is handled by a drupal defined callback. Part of its reason for existing is to save the coder the effort of having to define a callback manually.
Dec 14, 2011 at 22:16 comment added amateur barista What path in the Drupal site is JavaScript calling? What PHP function is handling that message. There's a PHP callback somewhere getting the message from JavaScript's XHR, and something tells me it's not your PHP function. If you do a error_log('foo bar baz'); on your PHP callback, what happens? Does "foo bar baz" appear on your error log?
Dec 14, 2011 at 22:13 comment added Bart Malks is right, you don't need hook_menu defined for an #ajax callback.
Dec 14, 2011 at 20:56 comment added amateur barista Also, check your PHP error log and the Drupal watchdog. It might have been throwing an error. "Hard" reload is not supposed to be the normal behavior, so one can only assume there's an error involved. I think again your error is that you're missing the AJAX callback (the hook_menu implementation).
Dec 14, 2011 at 20:55 comment added amateur barista I think you do. Else, how is Drupal going to find your function? I doubt there's some automagical behavior for that. Also check your Firebug. When you click on the languages button, what is the XHR (AJAX) callback path? Probably is thenameofyoursite.com/bar_form_callback.
Dec 14, 2011 at 20:32 comment added Malks I don't think you need a hook_menu() defined for the #ajax callbacks.
Dec 14, 2011 at 19:12 comment added amateur barista Hopefully it's just that you're missing the hook_menu() callback.
Dec 14, 2011 at 19:11 history edited amateur barista CC BY-SA 3.0
deleted 518 characters in body
Dec 14, 2011 at 18:43 comment added Bart As explained in my question, adding AJAX to the form is what I intend to do. "What could trigger this behaviour?" is a question on what causes the page to reload (yes, a hard reload). The page reloads when I select a language in the select box.
Dec 14, 2011 at 17:42 history answered amateur barista CC BY-SA 3.0