jnhayter Posted May 30, 2009 Share Posted May 30, 2009 I have a property site and users can input property text into a text area. The problem occurs when they go back to edit the property the text does not appear in the text box if the user copied and pasted text with a dash. below is the code for the text area <?php $dn = $row_prop->pdescrip; $dn = str_replace("<br>", "\r\n", $dn); $dn = htmlentities($dn,ENT_QUOTES,"UTF-8"); echo "<textarea name='descrip' rows='15' style='width:525' value=\"$dn\">$dn</textarea>"; ?> Can someone tell me how to get the text to appear after submitting copied and pasted text? Quote Link to comment https://forums.phpfreaks.com/topic/160220-need-help/ Share on other sites More sharing options...
Ken2k7 Posted May 30, 2009 Share Posted May 30, 2009 1. <textarea> does not have a value attribute - http://www.w3schools.com/TAGS/tag_textarea.asp 2. You can change the value of $dn to $dn = isset($_POST['descrip'])? $_POST['descrip'] : $row_prop->pdescrip; I think that is what you're looking for. Quote Link to comment https://forums.phpfreaks.com/topic/160220-need-help/#findComment-845442 Share on other sites More sharing options...
fullyscintilla Posted May 30, 2009 Share Posted May 30, 2009 why would it matter if its copied and pasted or simply typed.. either way the text is entered into the element and then passed to php.. Also you might be causing an error by appling the "value" attribute to the text area... should only be <textarea>$VariableName</textarea> little rusty on my code lately .. sry.. what is this again??(the quoted portion) $row_prop "->" pdescrip Quote Link to comment https://forums.phpfreaks.com/topic/160220-need-help/#findComment-845475 Share on other sites More sharing options...
Michdd Posted May 30, 2009 Share Posted May 30, 2009 why would it matter if its copied and pasted or simply typed.. either way the text is entered into the element and then passed to php.. Also you might be causing an error by appling the "value" attribute to the text area... should only be <textarea>$VariableName</textarea> little rusty on my code lately .. sry.. what is this again??(the quoted portion) $row_prop "->" pdescrip It means that it's an attribute of class. $class->classvariable Quote Link to comment https://forums.phpfreaks.com/topic/160220-need-help/#findComment-845479 Share on other sites More sharing options...
fullyscintilla Posted May 30, 2009 Share Posted May 30, 2009 lol and that means what?? i didn't know php had classes Quote Link to comment https://forums.phpfreaks.com/topic/160220-need-help/#findComment-845489 Share on other sites More sharing options...
Ken2k7 Posted May 30, 2009 Share Posted May 30, 2009 That "->" symbol is called an operator. Quote Link to comment https://forums.phpfreaks.com/topic/160220-need-help/#findComment-845491 Share on other sites More sharing options...
.josh Posted May 30, 2009 Share Posted May 30, 2009 It means that it's an attribute of class. $class->classvariable Don't wanna nitpick, but technically 'classvariable' would be a property, not an attribute. Is it called an attribute in some other OOP language? Just wondering where you got that term from. Quote Link to comment https://forums.phpfreaks.com/topic/160220-need-help/#findComment-845570 Share on other sites More sharing options...
Michdd Posted May 30, 2009 Share Posted May 30, 2009 It means that it's an attribute of class. $class->classvariable Don't wanna nitpick, but technically 'classvariable' would be a property, not an attribute. Is it called an attribute in some other OOP language? Just wondering where you got that term from. No where specifically I wasn't using real terminology, I guess. But property and attribute mean the same thing.. In English at least http://thesaurus.reference.com/browse/attribute Quote Link to comment https://forums.phpfreaks.com/topic/160220-need-help/#findComment-845573 Share on other sites More sharing options...
.josh Posted May 30, 2009 Share Posted May 30, 2009 yeah i know in general they mean the same thing, which is why I thought maybe some other language out there chose to call it attribute instead. Just curious. Quote Link to comment https://forums.phpfreaks.com/topic/160220-need-help/#findComment-845575 Share on other sites More sharing options...
Michdd Posted May 30, 2009 Share Posted May 30, 2009 yeah i know in general they mean the same thing, which is why I thought maybe some other language out there chose to call it attribute instead. Just curious. Maybe Python? http://www.faqs.org/docs/diveintopython/fileinfo_classattributes.html Quote Link to comment https://forums.phpfreaks.com/topic/160220-need-help/#findComment-845577 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.