Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
f0d8d3a0
Commit
f0d8d3a0
authored
Oct 07, 2016
by
Rafael Ostertag
Browse files
Added new events to Form: `form.validation.(before|after)`
parent
abbb3bb0
Changes
3
Hide whitespace changes
Inline
Side-by-side
javascript/src/Form.js
View file @
f0d8d3a0
...
...
@@ -116,12 +116,17 @@ var QfqNS = QfqNS || {};
* @returns {*}
*/
n
.
Form
.
prototype
.
validate
=
function
()
{
this
.
eventEmitter
.
emitEvent
(
'
form.validation.before
'
,
n
.
EventEmitter
.
makePayload
(
this
,
null
));
// uncommented because bootstrap-validator sets novalidate="true" on form.
//if (this.$form.attr('novalidate')) {
// return true;
//}
return
document
.
forms
[
this
.
formId
].
checkValidity
();
var
result
=
document
.
forms
[
this
.
formId
].
checkValidity
();
this
.
eventEmitter
.
emitEvent
(
'
form.validation.after
'
,
n
.
EventEmitter
.
makePayload
(
this
,
{
validationResult
:
result
}));
return
result
;
};
/**
...
...
javascript/src/QfqForm.js
View file @
f0d8d3a0
...
...
@@ -90,6 +90,7 @@ var QfqNS = QfqNS || {};
//n.Helper.jqxEditor();
n
.
Helper
.
tinyMce
();
this
.
form
.
on
(
'
form.submit.before
'
,
n
.
Helper
.
tinyMce
.
prepareSave
);
this
.
form
.
on
(
'
form.validation.before
'
,
n
.
Helper
.
tinyMce
.
prepareSave
);
};
n
.
QfqForm
.
prototype
.
on
=
n
.
EventEmitter
.
onMixin
;
...
...
mockup/personmock.html
View file @
f0d8d3a0
...
...
@@ -343,8 +343,8 @@
<label
for=
"notes-editor"
class=
"control-label"
>
Notes
</label>
</div>
<div
class=
"col-md-6"
>
<textarea
id=
"notes-editor"
class=
"
jqw-editor
"
data-control-name=
"notesField"
name=
"notesField"
>
<textarea
id=
"notes-editor"
class=
"
qfq-tinymce
"
data-control-name=
"notesField"
name=
"notesField"
required
>
</textarea>
</div>
...
...
@@ -836,7 +836,7 @@
</div>
</form>
<a
href=
"www.google.ch"
>
away
</a>
<a
href=
"
https://
www.google.ch"
>
away
</a>
</div>
<script
type=
"application/jqw-combobox-source"
id=
"combobox1_source"
>
...
...
@@ -853,6 +853,7 @@
<script
src=
"../js/validator.min.js"
></script>
<script
src=
"../js/jqx-all.js"
></script>
<script
src=
"../js/globalize.js"
></script>
<script
src=
"../js/tinymce.min.js"
></script>
<script
src=
"../js/EventEmitter.min.js"
></script>
<script
src=
"../js/qfq.debug.js"
></script>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment