Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
f0221fb8
Commit
f0221fb8
authored
Aug 26, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #4126
parent
902684ed
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
input-validation.md
docs/guide/input-validation.md
+11
-2
No files found.
docs/guide/input-validation.md
View file @
f0221fb8
...
...
@@ -620,8 +620,17 @@ You can use AJAX-based validation in this case. It will trigger an AJAX request
input while keeping the same user experience as the regular client-side validation.
To enable AJAX validation for the whole form, you have to set the
[
[yii\widgets\ActiveForm::enableAjaxValidation
]
] property to be
`true`
. You may also turn it on or off
for individual input fields by configuring their
[
[yii\widgets\ActiveField::enableAjaxValidation
]
] property.
[
[yii\widgets\ActiveForm::enableAjaxValidation
]
] property to be
`true`
and specify
`id`
to be unique form identifier:
```
php
<?php
$form
=
yii\widgets\ActiveForm
::
begin
([
'id'
=>
'contact-form'
,
'enableAjaxValidation'
=>
true
,
]);
?>
```
You may also turn AJAX validation on or off for individual input fields by configuring their
[
[yii\widgets\ActiveField::enableAjaxValidation
]
] property.
You also need to prepare the server so that it can handle the AJAX validation requests.
This can be achieved by a code snippet like the following in controller actions:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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