forked from extern/egroupware
Add a parameter for submit() to skip the client-side widget validation
This commit is contained in:
parent
24b75f7f01
commit
734b5d02f2
@ -473,21 +473,30 @@ etemplate2.prototype.isDirty = function()
|
|||||||
*
|
*
|
||||||
* @param {(et2_button|string)} button button widget or string with id
|
* @param {(et2_button|string)} button button widget or string with id
|
||||||
* @param {boolean} async true: do an asynchronious submit, default is synchronious
|
* @param {boolean} async true: do an asynchronious submit, default is synchronious
|
||||||
|
* @param {boolean} no_validation - Do not do individual widget validation, just submit their current values
|
||||||
* @return {boolean} true if submit was send, false if eg. validation stoped submit
|
* @return {boolean} true if submit was send, false if eg. validation stoped submit
|
||||||
*/
|
*/
|
||||||
etemplate2.prototype.submit = function(button, async)
|
etemplate2.prototype.submit = function(button, async, no_validation)
|
||||||
{
|
{
|
||||||
|
if(typeof no_validation == 'undefined')
|
||||||
|
{
|
||||||
|
no_validation = false;
|
||||||
|
}
|
||||||
|
|
||||||
// Get the form values
|
// Get the form values
|
||||||
var values = this.getValues(this.widgetContainer);
|
var values = this.getValues(this.widgetContainer);
|
||||||
|
|
||||||
// Trigger the submit event
|
// Trigger the submit event
|
||||||
var canSubmit = true;
|
var canSubmit = true;
|
||||||
this.widgetContainer.iterateOver(function(_widget) {
|
if(!no_validation)
|
||||||
if (_widget.submit(values) === false)
|
{
|
||||||
{
|
this.widgetContainer.iterateOver(function(_widget) {
|
||||||
canSubmit = false;
|
if (_widget.submit(values) === false)
|
||||||
}
|
{
|
||||||
}, this, et2_ISubmitListener);
|
canSubmit = false;
|
||||||
|
}
|
||||||
|
}, this, et2_ISubmitListener);
|
||||||
|
}
|
||||||
|
|
||||||
if (canSubmit)
|
if (canSubmit)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user