Questions tagged [yii-form]
11 questions
1
vote
1 answer
get value of selected dropdown option in yii2 controller
I'm trying to get value of selected dropdown menu from signup form. i need to store that value in db.
dropdown code is.
= $form->field($model, 'sex')->dropDownList(['1' => 'Male', '2' => 'Female'],['prompt'=>'Select Gender...'] )?>
I have tried…
user9867960
1
vote
1 answer
Custom attribute validation in Yii2
I have model form (SomeForm) and custom validation function in there:
use yii\base\Model;
class SomeForm extends Model
{
public $age;
public function custom_validation($attribute, $params){
if($this->age < 18){
…

godot
- 3,422
- 6
- 25
- 42
1
vote
1 answer
yii2 data to the db saves them all null
hello guys I have a problem when I send the form data in the database , all NULL fields are saved . Any suggestions?
my Controller
public function actionOffri()
{
$model = new Offri;
if($model->load(Yii::$app->request->post())&&…

Saba
- 115
- 1
- 15
0
votes
1 answer
Form returned bad request: Missing required parameters: id
I'm new to yii2 and I want to make a signup form using yii2 basic
I use the generated mvc from gii but when i submit the registration it returned bad request but some of the data i've input is in the database but some are missing too.
Here is my…

Nur Ilmi Hasbah
- 3
- 1
0
votes
1 answer
Yii2 form validating but not submitting to send email
I have a form that is not submitting anytime the submit button is clicked but it is validating.
see the form below:
'contact-form',
'action' => ['site/index'],
'options'…

James D
- 125
- 4
- 14
0
votes
1 answer
Yii2 remove form name from url parameters
I use Yii2 forms and after submit my URL looks…

alexanoid
- 24,051
- 54
- 210
- 410
0
votes
1 answer
YII1 how to set "anchor" for putting Jquery code there
Now I am working with one old system Which were developed with using YII 1 framework.
Yii1 form using some jquery code for form validation and put this code at the end before