Jump to content

Textarea won't work with mysql field data


Recommended Posts

Hi,

 

I am new to this code, the coder I hired to do this job quit on me before fixing all of the bugs, so please be patient with me.

 

I have a real estate property form on my site that displays fields from my mysql table in a form, so that I can enter property details and submit them to the database.

 

The normal fields that are varchar are being displayed properly in a normal text box form field, but the mysql fields that are supposed to be <textarea> form fields are also displaying as normal text form fields.  I need the <textarea> fields so that I can enter longer descriptions etc...and be able to see what I am typing.

 

From the code below is there any glaring mistakes that would fix this.  I have also attached the full bit of code that is supposed to generate the form.  Any help would be greatly appreciated.

 

 

 

foreach ($vars as $field) {

if ($varsSize[$field]=="text") {

$strDisplay .= "<tr>

<td valign=\"top\">".eregi_replace("_", " ", $field).":</td>

<td><textarea cols=\"35\" rows=\"3\" name=\"".$field."\" id=\"".$field."\">".$Property[$field]."</textarea></td>

</tr>";

} else {

$strDisplay .= "<tr>

<td valign=\"top\">".eregi_replace("_", " ", $field).":</td>

<td><input type=\"text\" name=\"".$field."\" id=\"".$field."\" value=\"".$Property[$field]."\" size=\"45\" maxlength=\"500\" /></td>

</tr>";

}

}

 

[attachment deleted by admin]

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.