8 – How to add a secondary Ajax submit to a regular node form?

I’m trying to add an Ajax submit to a regular node edit form (Drupal 9). I’m using Field Groups so that there’s a series of tabs, and I’ve added a pair of “buttons” (Right now they’re just markup <div>s, but I could change them to real buttons if that’s recommended) that users can use to move forward and back through the tabs with some Javascript.

The ask now is that each time the tab focus changes, the form is submitted via Ajax.
All the examples I’m finding seem to be doing something other than what I’m after. I’ve seen examples using completely custom forms, loading forms, and altering fields, but nothing that just adds the ability to submit a a regular node form with Ajax.

Things I’ve tried:

  • Adding an #ajax subarray of various sorts to the buttons and/or the regular submit element. Nothing Ajaxy at all has happened in any of these experiments
  • Using Javascript to trigger a click event on the submit, without and without an #ajax subarray. All I get is a regular submit with page refresh
  • Bypassing all of that just calling $.post($('#form-id').attr('action'), $('#form-id').serialize()). There’s some semblance of Ajax submit going on as my custom hook_form_alter gets hit, but the node isn’t saved/updated. I think that’s failing because there’s no proper submit/op value associated with it, and I haven’t been able to figure out how to add/set it.

Can someone point me in the right direction?

8 – User warning: issue after submit or save

User warning: The following theme is missing from the file system: calendar_systems in drupal_get_filename() (line 295 of core/includes/bootstrap.inc).
drupal_get_filename(‘theme’, ‘calendar_systems’) (Line: 314)
drupal_get_path(‘theme’, ‘calendar_systems’) (Line: 437)
DrupalCoreAssetLibraryDiscoveryParser->drupalGetPath(‘theme’, ‘calendar_systems’) (Line: 112)
DrupalCoreAssetLibraryDiscoveryParser->buildByExtension(‘calendar_systems’) (Line: 87)
DrupalCoreAssetLibraryDiscoveryCollector->getLibraryDefinitions(‘calendar_systems’) (Line: 66)
DrupalCoreAssetLibraryDiscoveryCollector->resolveCacheMiss(‘calendar_systems’) (Line: 149)
DrupalCoreCacheCacheCollector->get(‘calendar_systems’) (Line: 44)
DrupalCoreAssetLibraryDiscovery->getLibrariesByExtension(‘calendar_systems’) (Line: 58)
DrupalCoreAssetLibraryDiscovery->getLibraryByName(‘calendar_systems’, ‘picker’) (Line: 54)
DrupalCoreAssetLibraryDependencyResolver->doGetDependencies(Array) (Line: 31)
DrupalCoreAssetLibraryDependencyResolver->getLibrariesWithDependencies(Array) (Line: 104)
DrupalCoreAssetAssetResolver->getLibrariesToLoad(Object) (Line: 116)
DrupalCoreAssetAssetResolver->getCssAssets(Object, ) (Line: 315)
DrupalCoreRenderHtmlResponseAttachmentsProcessor->processAssetLibraries(Object, Array) (Line: 161)
DrupalCoreRenderHtmlResponseAttachmentsProcessor->processAttachments(Object) (Line: 45)
DrupalCoreEventSubscriberHtmlResponseSubscriber->onRespond(Object, ‘kernel.response’, Object)
call_user_func(Array, Object, ‘kernel.response’, Object) (Line: 111)
DrupalComponentEventDispatcherContainerAwareEventDispatcher->dispatch(‘kernel.response’, Object) (Line: 191)
SymfonyComponentHttpKernelHttpKernel->filterResponse(Object, Object, 1) (Line: 173)
SymfonyComponentHttpKernelHttpKernel->handleRaw(Object, 1) (Line: 68)
SymfonyComponentHttpKernelHttpKernel->handle(Object, 1, 1) (Line: 57)
DrupalCoreStackMiddlewareSession->handle(Object, 1, 1) (Line: 47)
DrupalCoreStackMiddlewareKernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupalpage_cacheStackMiddlewarePageCache->pass(Object, 1, 1) (Line: 85)
Drupalpage_cacheStackMiddlewarePageCache->handle(Object, 1, 1) (Line: 47)
DrupalCoreStackMiddlewareReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
DrupalCoreStackMiddlewareNegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
StackStackedHttpKernel->handle(Object, 1, 1) (Line: 708)
DrupalCoreDrupalKernel->handle(Object) (Line: 19)

Confirm Submit Popup or Checkbox


Your privacy


By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.




checkboxes – Submit button placement on a form with long columns

This question is related to the Sticky submit button at the top and bottom of the form?, and Submit button on top of the long form but I consider has other nuances.

I have a form that is made only with checkboxes. They don’t need to be all checked. I have some javascript to handle possible errors.

This is what can be seen on a standard monitor:

enter image description here

And this is the complete form:

enter image description here

At the top of each column, I have a button that allows the user to check or uncheck all, so the user can just uncheck all items and send the form without the need to scroll down to the bottom.

I thought the most convenient solution would be to place the submit button at the top of the form so as not to confuse the user if they don’t need to scroll to the end.

Is this a reasonable approach? Are there any reasons why it wouldn’t be?

How to submit sitemap to Baidu?

http://zhanzhang.baidu.com/sitemap/index is the (sparse) documentation about sitemaps for Baidu. It only describes that it may help to submit your sitemap, and it shows a screenshot of their webmaster tool, listing several sitemaps and their status. However, it seems that they intend this feature only for “high quality” sites, on invitation basis.

Here is also a FAQ about sitemaps: http://help.baidu.com/question?prod_en=master&class=477. They say, for example, that

So you’d need to register an Baidu account, login to their webmaster tool, add and verify your site(s) and then … wait and hope that you are invited to upload your sitemap. I don’t know their process, but I wouldn’t assume that this will happen for your sites.

Alternatives?

http://zhanzhang.baidu.com/sitesubmit/index is their site submission tool, which even works anonymously. It’s probably intended to submit your website’s homepage only (e.g., example.com), but you also get a success message (“URL提交成功” = something like “URL successfully submitted”) when entering the URL to your sitemap. However, this probably doesn’t mean that they’ll use your sitemap that way.

For blogs, they also offer a ping service http://ping.baidu.com/ping.html (XML RPC: http://ping.baidu.com/ping/RPC2) (documentation). Entering your feed there is also possible.

And special cases: For WordPress, there seems to be an official Baidu plugin that pushes any new content to Baidu and allows them to show updates in real time. For Discuz! forums, there is also a Baidu sitemap submission plugin.

php, passar ip através de botão submit para uma pagína

eai glr, tudo bom com vcs? então, estou com uma dúvida, fiz um sistema de login pra um projeto meu de escola, só que não to conseguindo resgatar o ip do usuário quando ele acessa, nesse caso devo passar uma variável através do botão submit? e resgatar a mesma na outra página?

views – Entity Browser Modal closes on Exposed Filter Submit Button

I’ve set up a commerce shop that uses Entity Browser to select product images. I set up a view to display the selectable images which has an exposed filter for the filename, so the user can search for the name of an image and then select it.

The entity browser works as desired, but if the user clicks the “apply”-button of the filter, the modal closes. Same behaviour with an iframe as well.

When I set the theme to Bartik it works. When I set the theme to Olivero, the modal isn’t closed, but the filter is not applied.

Would be great, if someone could point me any way to resolve this issue or just give me a hint where and how to investigate this further. Thank you very much in advance!

8 – Form submit field not available in form action – Drupal 9

I have a form submit method as below:

function mymod_form_submit(&$form, FormStateInterface $form_state) {
  $ka_selected = $form_state->getValue('ka_types');
  Drupal::state()->set('ka_types', $ka_selected);
  return $ka_selected;
}

This is perfectly returning the selected “Ka_types” field values. Now I want to call this $ka_selected to my custom action code:

public function execute(ContentEntityInterface $entity = NULL) {
    //Read all the fields from entity
    $comment = $entity->get('comment_body')->getValue();
    $file_uri = file_create_url($entity->field_attachment->entity->getFileUri());
    $file_name = $entity->field_attachment->entity->getFileName();
    $ka = $entity->ka_selected->entity->getValue(); **//error thrown here**
    dd($ka);
}

I am able to read other view entities but not just this one field. Any help on how I can read the $ka_selected in my custom action?

hooks – How do I limit the number of webforms a user can submit over a period of time?

I created a webform for a school registration. I would like to limit the number of submissions each user can do over a period of time (a school year). For example, from September first, 2021 to September first, 2022 each user can only make a single submission. However, from September 2, 2022, they should be able to make a new submission.

I know this is not possible using the webform settings.

Which hook used from the Webform module would allow me to achieve this? Which code should I use for that hook?

php – Alguien que halla solucionado este problema submit

tengo un botón submit para cerrar sesión con un name=”cerrar”, el type=”submit”, cuando ejecuto otro botón con otro nombre diferente se cierra la sesión así tenga otro nombre. mientras tenga submi se mete a esta parte ¿como evitar el problema con submit?

 <form action=""  method="POST">                   
                            <p  class="block">
                             <input class="estilosboton" name="cerrar" type="submit" value="1">
                             <input class="estilosboton" name="abrir" 

 <?php  
                            if ($_POST('cerrar')>=1) {    // bien            
                            session_start(); //to ensure you are using same session
                            session_destroy(); //destroy the session
                            header("location:/index.php"); //to redirect back to "index.php" after logging out
                            exit();
                                }     
                        ?>
                            </p> 
                            </form>