Fix form submission (#129)
* Fix check for radio and checkbox inputs * Fix GET form submission * Add example forms for testing * Refactor query string building
This commit was merged in pull request #129.
This commit is contained in:
1 parent
0c7af354fd
commit
07baae8e4d
8 files changed
+214
-38
No files matched your search
@@ -0,0 +1,10 @@
|
||||
module.exports = function(uri, key, value) {
|
||||
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i")
|
||||
var separator = uri.indexOf("?") !== -1 ? "&" : "?"
|
||||
if (uri.match(re)) {
|
||||
return uri.replace(re, "$1" + key + "=" + value + "$2")
|
||||
}
|
||||
else {
|
||||
return uri + separator + key + "=" + value
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user