# Need Help about Form-\>control("")

**URL:** <https://discourse.cakephp.org/t/need-help-about-form-control/3862>\
**Category:** Need Help\
**Created:** [February 2, 2018, 1:34pm UTC](https://discourse.cakephp.org/t/need-help-about-form-control/3862 "2018-02-02T13:34:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fx20318](https://avatars.discourse-cdn.com/v4/letter/f/4da419/32.png) [@fx20318](https://discourse.cakephp.org/u/fx20318)\
**Post date:** [February 2, 2018, 1:34pm UTC](https://discourse.cakephp.org/t/need-help-about-form-control/3862/1 "2018-02-02T13:34:21Z")

</div>

If I specify a character string containing underbar in Form-\> control (""), the character string after underbar will not be displayed as a label.  
The same result will be obtained even if it is “\ \_”.  
Could you tell me how to display the character string after underbar ?  
  
code\> Form-\> control (“xxxx\_yyyy”)  
result\> Xxxx

code\> Form-\> control (“xxxx\_yyyy”)  
result\> Xxxx\

Desired results\>xxxx\_yyyy

---

<div class="post-metadata">

**Author:** ![chriscarton](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/chriscarton/32/931_2.png) [@chriscarton](https://discourse.cakephp.org/u/chriscarton)\
**Post date:** [February 2, 2018, 7:53pm UTC](https://discourse.cakephp.org/t/need-help-about-form-control/3862/2 "2018-02-02T19:53:58Z")

</div>

Have you tried to use escape ?

echo $this-\>Form-\>control(‘name’, [  
‘escape’=\>false  
]);

---

<div class="post-metadata">

**Author:** ![fx20318](https://avatars.discourse-cdn.com/v4/letter/f/4da419/32.png) [@fx20318](https://discourse.cakephp.org/u/fx20318)\
**Post date:** [February 3, 2018, 11:03am UTC](https://discourse.cakephp.org/t/need-help-about-form-control/3862/3 "2018-02-03T11:03:02Z")

</div>

Thank you for your reply.  
I try following 3 code,

1. echo $this-\>Form-\>control(“xxx\_yyy”);  
Xxx Yyy
2. echo $this-\>Form-\>control(“xxx\_yyy”,[‘escape’ =\> false]);  
Xxx Yyy (same as 1)
3. echo $this-\>Form-\>control(“xxx\_id”,[‘escape’ =\> false]);  
Xxx

case 1,2 : underbar -\> white space  
case 3 : when string after underbar is “id”, underbar + “id” is not displyed.  
This is the first case I asked.

Is there a way(by Form-\>control() ) to display the specified character string as it is?

---

<div class="post-metadata">

**Author:** ![chriscarton](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/chriscarton/32/931_2.png) [@chriscarton](https://discourse.cakephp.org/u/chriscarton)\
**Post date:** [February 5, 2018, 4:58pm UTC](https://discourse.cakephp.org/t/need-help-about-form-control/3862/4 "2018-02-05T16:58:59Z")

</div>

I’m not sure at all but maybe the method $this-\>Form-\>control() is the problem. Have you tried to use a specific method for a type of field like echo $this-\>Form-\>text() ?

---

<div class="post-metadata">

**Author:** ![fx20318](https://avatars.discourse-cdn.com/v4/letter/f/4da419/32.png) [@fx20318](https://discourse.cakephp.org/u/fx20318)\
**Post date:** [February 6, 2018, 3:06pm UTC](https://discourse.cakephp.org/t/need-help-about-form-control/3862/5 "2018-02-06T15:06:27Z")

</div>

Thanks for your reply.  
As a workaround, I temporarily decided to get through with the following code.

[workaround code]  
echo $this-\>Form-\>label(“xxxx\_id”,array(‘label’ =\> ‘xxxx\_id’));

echo $this-\>Form-\>text(“xxxx\_id”);

if I specify [xxxx\_id] for Form-\> control (), it will be interpreted as the ID of [xxxx] table, and [listbox] will be displayed instead of [textbox].
