Jump to content

[SOLVED] input field initial value with "


ikmyer

Recommended Posts

I suppose this question very well could go in the HTML sections but my problem really comes along with storing data an using php to display it.

 

I have a edit form that gets populated with data from a Database and the input field may contain " or '

 

So I run into a problem with the page is created when this instance comes along and the " or ' ends the value="abcd" tag in the input field.

 

example:

 

Here is the php line

<input name="question" type="text" id="question" value="<?php echo $row_question_edit['question']; ?>" size="90" />

 

Here is the html from the line above...

<input name="question" type="text" id="question" value="Complete the following statement "Objectives be added in PXT --------"" size="90" />

 

Notice how the whole Value= should be "Complete the following statement "Objectives be added in PXT --------"" but the " right after the word statement ends the value= tag

 

Any way to get around this besides not allowing " or ' to be stored ?  Thanks !

Link to comment
https://forums.phpfreaks.com/topic/49800-solved-input-field-initial-value-with/
Share on other sites

the \ will not work...

 

I will have to store " in the database instead of storing "  So on the insert i need to convert " into "

 

I think i should be able to find the search and replace function of php...  Thank you for pointing me in the right direction !!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.