Closed luannebe closed 2 years ago
What if you move your quotation mark from the end of Massachusetts
to after nw
? So that it can be value="Massachusetts Ave NW"
Hi, Oh, sorry. I should have explained this better. The upper block is from my code. You have to use the horizontal scroll bar to see all of it. The lower block is a screen shot of the form field html in the browser, as shown by the Chrome Elements inspector. Somehow, the string up to the first white space gets enclosed in quotes, and the rest is floating to the right.
Maybe there is just an extra quote missing from the input
element?!
I tried and this seems to work
<input type="text" class="form-control" id="street_name" name="street_name" value="{{ old("street_name", "Massachusetts Ave NW") }}">
or more closely
.... value="{{ ..... }}" />
I think the quotes needed around the whole value that you are printing in the blade template.
Brilliant!!! it works. Thank you @gkorodi and @pllealfunes !
Hi, I would like to supply a default value for a form field. The following works, except that the default value is displayed in the form and saved as "Massachusetts" not "Massachusetts Ave NW." Any thoughts would be much appreciated.