I created a form using the module "Webform". Now I want to add an #ajax item to the submit button.  Here's what I already did:  use \Drupal\Core\Form\FormStateInterface;  function mytheme_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {   $form['#submit']['#ajax'] = array(     'callback' =&gt; '\Drupal\mymodule\Controller\DefaultController::process_form_submission'   ); }   The '#submit' field of the form now looks like this:  '#submit' =&gt; array(2)     '0' =&gt; string(12) "::submitForm"     '#ajax' =&gt; array(1)         'callback' =&gt; string(72) "\Drupal\mymodule\Controller\DefaultController::process_form_submission"   But the process_form_submission function is not called. Instead the page reloads on submit as before.
I'm using the Webform module for Drupal 8. The module confirmation settings for a form are the following:   Page (redirects to new page and displays the confirmation message) Inline (reloads the current page and replaces the webform with the confirmation message.) Message (reloads the current page/form and displays the confirmation message at the top of the page.) URL (redirects to a custom path or URL) URL with message (redirects to a custom path or URL and displays the confirmation message at the top of the page.)   But how am I able to submit a form via AJAX so that the page doesn't reload on submit, but a confirmation message still replaces the form? What did I do wrong?    EDIT:  Here is the solution which works:  First you have to hook the form alter function and set an AJAX callback (as in ):  use \Drupal\Core\Form\FormStateInterface;  function MYTHEME_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {   if ( isset($form['#webform_id']) &amp;&amp; $form['#webform_id'] == 'MYWEBFORM' )   {     // add an AJAX callback to the form submission     $form['actions']['submit']['#ajax'] = array(       'callback' =&gt; '\Drupal\MYMODULE\Controller\DefaultController::processFormSubmission',       'event' =&gt; 'click',     );   } }   Then in the processFormSubmission function you can process the form (put use \Drupal\Core\Form\FormStateInterface; at the top of your file) like:  // Instantiate an AjaxResponse Object to return. $ajax_response = new \Drupal\Core\Ajax\AjaxResponse();  /* do sth */  // in the DOM: replace the form with the text 'form submitted' $ajax_response-&gt;addCommand(new \Drupal\Core\Ajax\HtmlCommand('#MYFORM', 'form submitted'));  return $ajax_response;
How do i prove invertibility of this linear transformation Let $T$ be a linear transformation from a vector space $V$  over reals into $V$ such that $T-T^2=I$. Show that $T$ is invertible Need Help Fixing Grub after Installing Ubuntu 13.04 x64 Alongside Windows 8 on a Lenovo IdeaPad Y400 with UEFI I have a Lenovo IdeaPad Y400 that came pre-installed with Windows 8. I would like to run Ubuntu alongside it in a dual-boot configuration. I've spent the past week fiddling around, re-installing both Windows and Linux in various configurations, and I've come awfully close to success, but seem to have hit a snag with Grub.  For my most recent attempt, I took the following steps:   Disabled Secure Boot Re-imaged Windows 8 from a hidden recovery partition, effectively restoring the machine to factory state Activated an option called Legacy Support in the BIOS (or is it UEFI now?) Booted Ubuntu 13.04 x64 from a USB stick, chose "install alongside Windows" and accepted all default options After a restart, found that I could boot Ubuntu, but could not boot Windows Once into Ubuntu, I ran Boot Repair with recommended settings and accepted all defaults. When Boot Repair finished, I was presented with the following message:      The boot files of [The OS now in use - Ubuntu 13.04] are far from the   start of the disk. Your BIOS may not detect them. You may want to   retry after creating a /boot partition (EXT4, >200MB, start of the   disk). This can be performed via tools such as gParted. Then select   this partition via the [Separate /boot partition:] option of [Boot   Repair]. ()    I followed the instructions at the url in the message, creating a 1GB EXT 4 partition near the start of the drive  when I tried to run Boot Repair again, the "Separate /boot partition" option on the "Grub Location" tab was disabled.  The new partition is /dev/sda11 and has the label GRUB. On restart, I get the following error message:      error: file '/boot/grub/i386-pc/normal.mod' not found.    grub rescue>    However, if I manually choose the boot partition by hitting F12, I can boot into Windows no problems. Selecting Ubuntu from the boot device menu gives me a Grub menu with the following options:      Ubuntu      Advanced options for Ubuntu       Windows UEFI recovery bootmgfw.efi      Windows Boot UEFI recovery       Windows UEFI recovery LrsBootmgr.efi      Windows Boot UEFI recovery bkpbootx64.efi       Windows Recovery Environment (loader) (on /dev/sda3)       Windows 8 (loader) (on /dev/sda5) System setup    Selecting Ubuntu from this menu allows me to get to my Ubuntu desktop. I haven't tried the other options yet for fear of losing the progress that I've made.   So it looks like I have successfully dual-booted the machine, but that Grub is broken for some reason or another.   My current partition scheme can be seen at:   Thanks in advance - Jonathan Badge symbol in notification is of the site you're on, not where badge was earned It's so cool that the notification reminds you of the colour of badge you've earned. But I am a little puzzled by the symbols:      Is it feasible to use the symbol from the earned site? At the moment it uses the symbol from the site I happen to be on (as you can see by looking to the left of the dropdown in each case.) How do I use the different shutter speeds my camera offers? Significance of the second focus in elliptical orbits Performance of Non Clustered Indexes on Heaps vs Clustered Indexes Disable display of passwords on an iPhone? Once you have defined a passcode to unlock an iPhone, and for every application asking a password, when waiting for a password an iPhone makes a transient display of any character you type. It is clear that this transient display was purposefully set in place to help people who have problems with passwords or with the on screen keyboard. This transient display lasts 3 seconds to avoid too big a security problem. But this is still largely sufficient for anyone behind you to read it really easily. Moreover this transient display can be easily captured by any camera or by a software on the iPhone:    I evaluate this echo of any password as a serious risk. This echo partially exposes a secret.  Is there any simple configuration method to suppress everywhere this mechanism of transient display of any password?    For information, I reported this security problem at :     Once I have defined a passcode to protect my iPhone, and within every   application asking me a password, when entering my password iOS makes   a transient display of any character I type. I guess that this   transient display of passwords was purposefully set in place to help   people who have problems with passwords or with the on screen   keyboard. This transient display lasts 3 seconds to avoid to create   too serious a security problem. But this is still amply sufficient for   anyone behind you to read it really easily.      This transient display can be easily captured by a camera   surreptitiously activated by a malicious neighbour.      I didin't find any easy way to block this security weakness with iOS 7   up to iOS 9.      How to disable this transient display of any password on iOS? I usually use "at a company" but I have encountered some articles using "in a company", "in XYZ firm" or "in an organization".  Which one is right? Cube of an integer $\frac{x}{y}+\frac{y}{z}+\frac{z}{x}=k$ and $x, y, z, k$ are integers.  Prove that $xyz$ is cube of some integer number.    I was wondering about giving a parametrization for the rational points on the elliptic curve in $\mathbb{P}^2(\mathbb{R})$ $$ x^2 y + y^2 z + z^2 x = k xyz$$ but I am not too confident in the topic, so I am asking you to shed some light.  Thank you for your help. How to show $\sum_{k=0}^{n}\binom{n+k}{k}\frac{1}{2^k}=2^{n}$ How does one show that $$\sum_{k=0}^{n}\binom{n+k}{k}\frac{1}{2^k}=2^{n}$$ for each nonnegative integer $n$?  I tried using the  but I guess I am applying it incorrectly. With the snake oil technique we have $$F(x)= \sum_{n=0}^{\infty}\left\{\sum_{k=0}^{n}\binom{n+k}{k}\frac{1}{2^k}\right\}x^{n}.$$ I think I have to interchage the summation and do something. But I am not quite comfortable in interchanging the summation. Like after interchaging the summation will $$F(x)=\sum_{k=0}^{n}\sum_{n=0}^{\infty}\binom{n+k}{k}\frac{1}{2^k}x^{n}?$$ Even if I continue with this I am unable to get the correct answer.  How does one prove this using the Snake oil technique?  A combinatorial proof is also welcome, as are other kinds of proofs. $\lim_{h\to 0}\int \frac{f(x+h)-f(x)}{h}\,\mathrm{d}x = f(b)-f(a)$ Let $f:[a,b]\to  R$ be integrable and continuous on $(a,b)$. Prove that: $$\lim_{h\to 0} \int_a^b\frac{f(x+h)-f(x)}{h} \,\mathrm{d}x = f(b)-f(a).$$  What I've tried so far: make a change of variables, which didn't help. I also thought of using the intermediate value theorem inside the integral, but the function being differentiable is not specified. Any help, tips? Thanks in advance! In Terraria I often try to defeat spazmatism first, but when he transformed, his flamethrower killed me. What is easiest way to kill The Twins? What is the tolerable magnetic field (in Tesla) for a hard disk? I was wondering what would be the safest magnetic field for a hard drive so that the data inside it is safe and not wiped off?  For example I have a 2.1 home theatre system and when I take my android phone near it to check the magnetic field range it gives me a reading of 1000 micro Tesla. Would that be considered safe for a nearby hard disk? How to make a blank page in Google Chrome at start-up? How to print the entire array list without appending the index in Java? Prove that the average of iid Gaussian random variables is Gaussian Given $x_1, \ldots, x_N$, independent and all distributed as a   Gaussian with mean $\mu$ and variance $\sigma^2$. Then, the average   $$\bar{x} = \frac{1}{N}\sum_{i=1}^Nx_i$$ is distributed as a Gaussian   with mean $\mu$ and variance $\frac{\sigma^2}{N}.$   This is a very well-known result. Anyway, I'm looking around to find a proof for this and I'm not having luck. Drawing text on an image background that has dark and bright parts Often, I want to write text over a background image. If the background image is bright, I use a dark color for the text, and vice versa. But, often the image has both dark and bright parts. So a dark text is unreadable on the dark parts, and a bright text is unreadable on the bright parts.  I currently use one of several solutions, all of them are imperfect:   Brighten the image and use a dark font, or darken the image and use a white font; the problem is that it reduces the beauty of the background image. Use grey text (as in this question:  ). But grey text often looks unappealing, and is still only barely readable. Use dark text, and try to position it on the bright spots of the image (or vice versa). This takes a lot of time because it requires me to position each word separately.   Are there better solutions to this problem?   In particular: is there an automatic tool that takes an image and a text, and positions the text only on the dark/bright parts of the image? How to get Ubuntu download for a Mac? Is there a design pattern for dropdown lists in iOS? How to iterate through the name of files in a folder Assume I have many TeX files. For the sake of simplicity, also asssume they are in a single folder or directory.  I want to input all files from within my main LaTeX document. Actually I can create a list of those files using C# in advance.  To enrich my view about LaTeX or TeX, could you tell me whether or not this job can be done only by using pure TeX or LaTeX?