Answers.Body: <p>I have solved it by myself;</p>
  
  <pre><code>$application = $event-&gt;sender-&gt;application;
  </code></pre>
  
  <p>Even for radio button's value, no suffix is necessary like <code>value</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-05T19:43:07.450Z
Answers.LastActivityDate: 2019-07-05T19:43:07.450Z
Answers.UserDisplayName: Kota.M
Body: <p>I have been developing validations for my form.</p>
  
  <p>It is possible to get text input's value like;</p>
  
  <p><code>$password = Craft::$app-&gt;request-&gt;getBodyParam('password');</code></p>
  
  <p>However, this function seems not to work for radio button fields. Could you tell me how to get radio button's value?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-07-04T17:37:48.457Z
Comments.Text: I found that getBodyParam function's param is the element's id. However, for radio button, the key must be name. What should I do?
Comments.UserDisplayName: Kota.M
Tags: <craft3><form><php>
Title: Get radio button's value from a form by PHP
ThreadText: # Get radio button's value from a form by PHP
  
  (Asked by: username_0 on 2019-07-04)
  
  I have been developing validations for my form.
  
  It is possible to get text input's value like;
  
  `$password = Craft::$app->request->getBodyParam('password');`
  
  However, this function seems not to work for radio button fields. Could you tell me how to get radio button's value?
  
  **Tags:** craft3, form, php
  
  > **Comments:**
  > **username_0**: I found that getBodyParam function's param is the element's id. However, for radio button, the key must be name. What should I do?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-07-05. Score: 1
  
  I have solved it by myself;
  
  ```
  $application = $event->sender->application;
  
  ```
  
  Even for radio button's value, no suffix is necessary like `value`.
  
  
  ---
  
  