Skip to content

Commit 165c82d

Browse files
committed
Update README.md
1 parent a83a40a commit 165c82d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ jquery-maxsubmit
33

44
jQuery plugin to detect if too many form items will be submitte for the server to cope with.
55

6+
## Introduction
7+
68
Some appications, such as ecommerce sites, can have administration forms that submit well
79
over a thousand parameters. PHP, by default, is set to accept only one thousand parameters
810
and so some of the submitted data can get lost.
@@ -16,13 +18,19 @@ Luckily the maximum number of accepted parameters can be changed in php.ini The
1618
many site owners have no idea this needs to be done until it is too late and their
1719
WooCommerce store has lost half its product variations.
1820

21+
## Plugin Purpose
22+
1923
What this jQuery plugin attempts to do, is warn the site administrator before a form is
2024
submitted, on the client (browser) side, and give the administrator a chance to cancel the
2125
submit and change the settings on the server. It does this by counting how many items
2226
will be submitted in a form (it does this, hopefully, intellidently by taking into account
2327
all the form item types and selected values). The plugin is given the maximum number of
2428
items the server will accept when the page is generated, so it has a number to compare to.
2529

30+
## Implementation
31+
32+
### Client-side JavaScript
33+
2634
The simplest way to implement the check is to use this JavaScript in the jQuery ready()
2735
function:
2836

@@ -33,6 +41,8 @@ be POSTed by the form. Additional settings allow you to modify the confirm box t
3341
or replace the standard confirm box with something more ambitious, such as a jquery.ui
3442
dialog. You can target specific forms with different settings if you wish.
3543

44+
### Server-side Code
45+
3646
The server limit (1000 in this case) needs to be passed into the script above. This can
3747
be found with a simple PHP function like this:
3848

@@ -65,7 +75,7 @@ be found with a simple PHP function like this:
6575
That runs on the server and provides the server settings to insert into the JavaScript
6676
initialisation, and will return 1000 by default on most PHP servers.
6777

68-
A simnple demo (index.php in this project) is running here: [http://www.acadweb.co.uk/maxsubmit/]
78+
A simple demo (index.php in this project) is running here: [http://www.acadweb.co.uk/maxsubmit/]
6979

7080
The jQuery plugin and the PHP function are the two building blocks. I intend to wrap them into a
7181
simple WordPress plugin next. Just install it along with your WooCommerce plugin, and it will stop

0 commit comments

Comments
 (0)