-1

I am calling the html code from the SQL into a the "value" of Textarea or For instance

<Input type=text value="<p>this is a website <a href="https://example.com>Click Here</a></p>"></input>

Now The problem is that The " in the href is closing the value and complete data is not displayed in the textbox.

Same is happening with the textarea.

Is there any other method to convert this html into editable form without breaking the website.

I am trying to update the html code in the SQL via a form through ajax. The update is working fine but i am unable to retrieve the code from the SQL into the any editable text input.

1 Answers1

0

Use single quotes, instead of double quotes for the outer value field:

<Input type=text value='<p>this is a website <a href="https://example.com>Click Here</a></p>'></input>

You can also try using JSON encode which will escape the double quotes.

TygerTy
  • 705
  • 6
  • 10