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. 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…
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 tag. I need to make YII1 form to put its validation code a bit…
Eugene S
  • 161
  • 1
  • 7
0
votes
1 answer

Not able to submit form inside footer in Yii2

I've a subscribe newsletter form inside footer that display on all page. To do this I've created a subscriber widget like this: SubscriberWidget.php
Alex
  • 996
  • 2
  • 10
  • 17
0
votes
0 answers

Yii1 Get options selected in dropdown when options has extra atrributes

When i add extra atrribute to options in CHtml::dropDownList(), i am not able to set options selected. Without adding extra atrribute to CHtml::dropDownList(), i am able to get an option selected and the code for this is echo…
Vikky
  • 43
  • 1
  • 7
0
votes
2 answers

yii2 change gridview model

I am maintaining a form with a model and a grid of child records. I want the grid to show url of the child, not the parent. I have two database tables which share a parent-child relationship. I showed only the important fields. describe…
crafter
  • 6,246
  • 1
  • 34
  • 46
-1
votes
3 answers

Post inside controller not loading into model in Yii2

When I want to get the variable from the form the post action doesn't load . This is my view: