Laravel Form & HTML Escaped

Published 1 month ago by masandikdev

Hi,

how to not escaped when using laravel html form, its okay when using input but have problem when using textarea. i have form to submit content that have spintag text that contain {{ and }}.

Form result with input

{{test}} text is {good|excelent|nice} example

Form result in textarea

text is {good|excelent|nice} example

any advice, why its escaped when using textarea. thanks

ejdelmonico

That is risky to unescape the user entered data. but you can use {!! !!}

masandikdev

i already do that and still not showed when i get data from database and loop it like.

{!! Form::textarea($value->id, $value->value, ['class' => 'form-control']) !!}

but when using Form Text its working without escaped.

masandikdev

even when im using html instead laravel form like:

<div class="col-md-7">
<textarea name="{{ $value->id }}" cols="50" rows="10" id="{{ $value->id }}" class="form-control">{!! $value->value !!}</textarea>
</div>

still its not working, so its html / browser issue not laravel issues. thanks

ejdelmonico

Maybe give {{{ }}} a try.

masandikdev

same, just try with that. i think i can stick with input rather than textarea.

Please sign in or create an account to participate in this conversation.