Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vandyczech's avatar

Input not display full string

I have normal input with string. But when I want edit the article, the input show only several characters of string, not full string, why? And how can I fix this?

This is because the input string contains the gap between words?

// show only string
<input type='text' class='form-control' name='$name' value='string with gaps' required>

// show full
<input type='text' class='form-control' name='$name' value='stringwithgaps' required>
0 likes
9 replies
bobbybouwmann's avatar

Well it's not because of the gaps. Are you sure your data is saved correctly in your database?

It's probably nothing but I always learned to use double quotes " for inputs and classes

<input type="text" class="form-control" name="{{ $name }}" value="string with gaps" required>
4 likes
yuvi_raj's avatar

@bobbybouwmann This worked for me, I have the same issue and by adding the value in double quotes the issue s resolved. Thanks for the solution

bobbybouwmann's avatar

How do you display your data? Do you use blade? What do you pass to the view? Is the data that you pass to the view correct?

vandyczech's avatar

Yes, blade. Clasically from controller via return view like this:

     return()->with()
Jaytee's avatar

I don't believe this would affect the issue however shouldn't the required attribute be 'required=true' ? (Without the quotes)

Snapey's avatar

Do you have any html in your text field?

Load your view with data and then view HTML source. Check the input field, does it contain all the data?

Mohammad_Ariful_Hoque's avatar

I have also faced this problem. Place your blade syntax between double or single quotes for the 'Value' attribute.

1 like

Please or to participate in this conversation.