Wiki

Articles tagged with "form", sorted by commentsX
Displaying 1-10 of 17 result(s).

Update two models with one view

Created 6 years ago by sensorarioTips11 comments – viewed 42,564 times – ( +10 / -3 ) – version 1.1
Suppose to have two models: Users and Emails. You do not want to store email in a Users model. And User can have 0 or many emails. This is the form generated to create a new user (just username).
tags: database, model, view, form

Show captcha after <N> unsuccessfull attempts

Created 5 years ago by zitterHow-tos7 comments – viewed 22,918 times – ( +15 / -6 ) – version 1.1
In this mini howto I would like to show how to add a required captcha field in the login form, after a defined number of unsuccessfull attempts. To do this, I will use the blog demo that you have in default Yii download package (path/to/yii/demos/blog).

Additional form data with XUpload

Created 5 years ago by AsgarothHow-tos7 comments – viewed 37,523 times – ( +9 / -1 ) – version 1.1
In this article you'll learn how to send additional form data when uploading files using XUpload widget

Load data from internal/external source to fill form fields

Created 2 years ago by skwordenHow-tos4 comments – viewed 14,677 times – ( +1 / -1 ) – version 2.0
This wiki is to show you how to use jQuery get and JSON to get data from a dropdown/any form field and fill form fields with the values instantaneously. First, I'll give example use cases of what I'm going to teach you so you can quickly see if this is for you.

Updating fields on a form with Ajax and Json

Created 6 years ago by Russell EnglandHow-tos4 comments – viewed 58,249 times – ( +12 / -2 ) – version 1.1
I'm developing a website that has an option to look up a car's registration number via SOAP and return additional details such as make, model, colour etc.

Save or Update Multiple related model values in one Tabular input form

Created 3 years ago by Kostas Apazidis (KonApaz)Tutorials4 comments – viewed 23,101 times – ( +1 / -8 ) – version 1.1
In this wiki I will show you how to save/update a model with many related model For example: How to set a product to multiple categories only in one post form ?

Create Form With DynamicModel

Created 3 years ago by Misbahul D MunirTips4 comments – viewed 19,416 times – ( +2 / -1 ) – version 2.0
In yii2 we can create form without create FormModel. Here we go
tags: form, yii2, model

CGridView: Use special variable $data in the htmlOptions of a column (i.e. evaluate htmlOptions attribute)

Created 5 years ago by c@cbaTutorials3 comments – viewed 65,317 times – ( +28 / -2 ) – version 1.1
    For each column of the CGridView, we can specify name, value, htmlOptions, cssClassExpression etc. In the declarations of the attributes value and cssClassExpression we can use the "special" variable $data, for example like this: 'value'=>'$data->author->username',.     Now we might want to use $data in the declaration of the htmlOptions attribute, which is normally not possible, to generate for example the tag <td id="3" class="name_3">, where 3 is the id of the data model for the current row, i.e. $data->id. That is, we want to be able to use: 'htmlOptions'=>array('id'=>'$data->id', 'class'=>'"name_{$data->id}"')     Here's a way to accomplish this...

Simple revealing and hiding the password in the password field

Created 2 years ago by BizleyHow-tos2 comments – viewed 8,109 times – ( +2 / -1 ) – version 2.0
There are numerous usability problems:

FORM with GET method causes repeated stacking of URL Parameters

Created 3 years ago by Kartik VTips2 comments – viewed 30,496 times – ( +45 / -5 ) – version all
You are using an ActiveForm in yii (both v1.x or 2), with a GET method like below: