Skip to content

Instantly share code, notes, and snippets.

/.java Secret

Created August 3, 2015 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/f689261241ecd50e25a4 to your computer and use it in GitHub Desktop.
Save anonymous/f689261241ecd50e25a4 to your computer and use it in GitHub Desktop.
//use the temporarily stored executeOptions
var executeIds = executeOptions.split(/[ ]+/);
//this function checks whether the given element-name is part of the
//"execute"-property of the ajax-request.
//The given parameter is the name of the currently iterated form-element
var isFieldExecutable = function (name) {
//submit nothing if execute @none is set
if (executeNone) {
return false;
}
//submit all values if @all or @form is set as execute option
if (executeAll || executeForm) {
return true;
}
//form-name is always submitted (if execute @none is not set)
if (name === form.name) {
return true;
}
//check whether the given element-name was set in the "execute"
//section of the ajax request
return arrayContains(executeIds, name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment