Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
formatting
Source Link
Elin Y.
  • 7.4k
  • 1
  • 41
  • 65

I have made a form in drupal. What

What I want is when the browser unload the page from any click whether by clicking on anchor tag or from browser refresh buttons I want to save data of my form through js/ajax or anything possible in drupal. If

If any more explanation needed please do ask me. Thanks in advance. I

I was trying do this by browser 'unload' event and 'beforeunload' event. But unable to save data of my form because browser doesn't wait for anything writtent inside and just ask for confirmation. Any help will appreciated. This

This what I was trying to do: $(window).bind('beforeunload', function() { return 'Do you really want to leave?' ;//coming here instead of it what i want //is //save the form then return if user says yes and no the don't save the form. });

$(window).bind('beforeunload', function() {
  return 'Do you really want to leave?';
  //coming here instead of it what i want
  //is save the form then return if user says yes and no the don't save the form.
});

I have made a form in drupal. What I want is when the browser unload the page from any click whether by clicking on anchor tag or from browser refresh buttons I want to save data of my form through js/ajax or anything possible in drupal. If any more explanation needed please do ask me. Thanks in advance. I was trying do this by browser 'unload' event and 'beforeunload' event. But unable to save data of my form because browser doesn't wait for anything writtent inside and just ask for confirmation. Any help will appreciated. This what I was trying to do: $(window).bind('beforeunload', function() { return 'Do you really want to leave?' ;//coming here instead of it what i want //is //save the form then return if user says yes and no the don't save the form. });

I have made a form in drupal.

What I want is when the browser unload the page from any click whether by clicking on anchor tag or from browser refresh buttons I want to save data of my form through js/ajax or anything possible in drupal.

If any more explanation needed please do ask me. Thanks in advance.

I was trying do this by browser 'unload' event and 'beforeunload' event. But unable to save data of my form because browser doesn't wait for anything writtent inside and just ask for confirmation. Any help will appreciated.

This what I was trying to do:

$(window).bind('beforeunload', function() {
  return 'Do you really want to leave?';
  //coming here instead of it what i want
  //is save the form then return if user says yes and no the don't save the form.
});
Source Link

Save form when user refreshes page from browser or click on any anchor tag inside page

I have made a form in drupal. What I want is when the browser unload the page from any click whether by clicking on anchor tag or from browser refresh buttons I want to save data of my form through js/ajax or anything possible in drupal. If any more explanation needed please do ask me. Thanks in advance. I was trying do this by browser 'unload' event and 'beforeunload' event. But unable to save data of my form because browser doesn't wait for anything writtent inside and just ask for confirmation. Any help will appreciated. This what I was trying to do: $(window).bind('beforeunload', function() { return 'Do you really want to leave?' ;//coming here instead of it what i want //is //save the form then return if user says yes and no the don't save the form. });