Skip to content
Advertisement

Yii radioButtonList: always takes the default value as the selected value

I have Yii radio button list as follows.

forgotpassword1.php

JavaScript

This is the action for forgotpassword1.

JavaScript

Here I call a function named “ChangePassword()” from my backend application. One of the parameters passed to the backend is send_type: mobile or email. The problem is it will always takes mobile as the send_type. I’ve used

JavaScript

to set the default value as mobile.

Why it always takes mobile as the send type.

Any suggestions are appreciated.

Thank you in advance

Advertisement

Answer

Try with this :

JavaScript

In your Acion :

  • To set the default value :

    JavaScript
  • To get the checked value (check whether it’s 1 or 2) :

    JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement