Jump to content

drop down list from array not entering value correctly


bradkenyon

Recommended Posts

$imgurl = '<img src="/images/icons/img.jpg">';

doctypes = 	array(array("label"=>"(select type)","value"=>""),
                array("label"=>"A4","value"=>"$imgurl"));

 

i am trying to output the drop down w/ select type, and A4, but A4 has the value of <img src="/images/icons/img.jpg">, but it stores that value in the db as <img src=

 

also, in the drop down, it lists A4, and adds a bit of the html into the drop down field, as you'll see in the image.

 

this is the html of it in the source code:

 

<select name='D_doctype' size='1' /><option value="">(select type)</option>
<option value="<img src="/images/icons/img.jpg">">A4</option>
</select>

 

does anyone know why it only stores <img src= in the db table, i put addslashes around it when its inserted into the database, as well as why the html source code is being displayed funny in the drop down, but looks fine in the source code.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.