1
CoolPops
Help using XoopsFormDhtmlTextArea
  • 2004/12/22 21:37

  • CoolPops

  • Just popping in

  • Posts: 65

  • Since: 2003/4/9 1


It's showing up and working on the form however it's the return value that's confusing me.

In the form I type in:

=========
Hello,

My name is CoolPops
=========

then save it to my database via a

sprintf("INSERT INTO ...%s",
$this->db->quoteString($_POST['dhtmlValue']));

In my database it is stored correctly. However, when putting that value into the DhtmlTextArea via:

$form->addElement(new XoopsFormDhtmlTextArea('DHtml Value', 'dhtmlValue', $entry->getVar('dhtmlValue'), 15, 80));

the textarea has:

===========
Hello,<br /><br />My name is CoolPops
===========

Then when saving again, the database then has:

===========
Hello,<br /><br />My name is CoolPops
===========

What am I doing wrong? I know something must be missing here.

Also, how does the word sensoring, XOOPS codes, smile faces, etc... come into play

Thanks,

CoolPops

2
Mithrandir
Re: Help using XoopsFormDhtmlTextArea

the imperative in this context is this:
$entry->getVar('dhtmlValue')

I presume that the class of $entry is a child class to XoopsObject and that you use the inherited getVar() method to retrieve values

However, in getVar() there is a check to see the type of value and sanitize it for display - this means converting linebreaks to <br />. It is so, because getVar takes a second "hidden" parameter; $format = "show".

In order to get the value for editing, you will need to retrieve the value with
getVar('value_name''e')

'e' is for 'edit' and will not convert linebreaks or translate bbcode tags

Login

Who's Online

166 user(s) are online (126 user(s) are browsing Support Forums)


Members: 0


Guests: 166


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits