[FX.php List] A little JQuery/javascript help

Jonathan Schwartz jschwartz at exit445.com
Thu Aug 30 17:16:36 MDT 2012


Sorry for the delay.

I have documented the challenge here:

http://exit445.com/testform.php


Jonathan

At 11:16 AM -0400 8/27/12, Denis Somar wrote:
>Hi Jonathan,
>
>Put the <form> code in the email also, just to see what we're 
>dealing with here.
>
>D
>
>On Sun, Aug 26, 2012 at 7:06 PM, Jonathan Schwartz 
><<mailto:jschwartz at exit445.com>jschwartz at exit445.com> wrote:
>
>Hi Folks,
>
>I've added a short script to a page to help remind the user to save 
>their data before leaving a form.  I found the script in a JQuery 
>page, but don't know how to make a needed modification.
>
>It works as needed if the user tries to leave the page. But, it also 
>warns the user when the Submit button is clicked to save the data. 
>That's one case where it should not produce a warning.
>
>Anyone know how to disarm the script in the single case of when the 
>submit button is clicked, the javacsript equivalent of
>
>         if(!isset($_POST['submit']))...
>
>Thanks.
>
>JOnathan
>
>
>
><script lanuage="Javascript">
>var form_clean;
>
>// serialize clean form
>$(function() {
>     form_clean = $("form").serialize();
>});
>
>// compare clean and dirty form before leaving
>window.onbeforeunload = function (e) {
>     var form_dirty = $("form").serialize();
>     if(form_clean != form_dirty) {
>         return 'There is unsaved Event data.';
>     }
>};
></script>
>--
>Jonathan Schwartz
>Exit 445 Group
><mailto:jonathan at exit445.com>jonathan at exit445.com
><http://www.exit445.com>http://www.exit445.com
><tel:415-370-5011>415-370-5011
>_______________________________________________
>FX.php_List mailing list
><mailto:FX.php_List at mail.iviking.org>FX.php_List at mail.iviking.org
><http://www.iviking.org/mailman/listinfo/fx.php_list>http://www.iviking.org/mailman/listinfo/fx.php_list
>
>
>
>_______________________________________________
>FX.php_List mailing list
>FX.php_List at mail.iviking.org
>http://www.iviking.org/mailman/listinfo/fx.php_list


-- 
Jonathan Schwartz
Exit 445 Group
jonathan at exit445.com
http://www.exit445.com
415-370-5011
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20120830/34c5649e/attachment.html


More information about the FX.php_List mailing list