I have modified the invite a friend page to suit my needs, but the client does not like the standard textarea box, as he wants users to be able to format their text.So,I have been trying to figure out how to implement the standard tinyMCE from dolphin to take effect on my page.
Specifics:
Again,I am using a modified version of the invite a friend. Basically, all i did was change the email field to a textarea and remove the name and email fields.
This is the field info:
'subjective' => array(
'type' => 'textarea',
'name' => 'subjective',
'caption' => _t("Subjective"),
'value' => $Subjective_data,
'required' => true,
'html' => 2,
'checker' => array (
'func' => 'length',
'params' => array(3, 4555),
'error' => _t('_sys_adm_form_err_required_field'),
),
),
This is from my variables:
$_page['css_name'] = array('forms_adv.css');
$_page['js_name'] = array('http://www.myther.com/plugins/tiny_mce/tiny_mce.js');
Since it is not displaying as a tinymce, of course it isnt working. but this is what I do get.
After adding 'html' => 2,
I now have to double click the link to get the popup to open - instead of a single click like it was before without the added code.
Plus - the open field is now extending way paste the right edge of the block - and even after widening in forms_adv.css
Also - while trying to get things to work - i kept getting header conflict.
// output AJAX form submission result
if (bx_get('BxAjaxSubmit')) {
header('Content-type:text/html;charset=utf-8');
echo $sPageCode;
exit;
}
$sPageCode = $GLOBALS['oSysTemplate']->parseHtmlByName('default_margin.html', array('content' => $sPageCode));
// output ajax popup
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
$aVarsPopup = array (
'title' => $_page['header'],
'content' => $sPageCode,
);
header('Content-type:text/html;charset=utf-8');
echo $GLOBALS['oFunctions']->transBox($GLOBALS['oSysTemplate']->parseHtmlByName('popup-client-chart.html', $aVarsPopup), true);
exit;
}
it seems to me that those in red should be set as multipart/form-data.
I just tried something that gave me some progress - Instead of 'html' => 2, I changed the 2 to true, and now i it doesnt stretch wider than the box, and it even added the scroll bar - this is cool.
But let me explain why i want the tinymce - or at least a limited functioning one. When a user enters data into that field, I need to keep formatting such as line breaks and new paragraphs. If this can be done without all the extra stuff at the top - that would be great, but just to get anything to work would be great at this point.
first pic is the html => 2; second pic is the html => true
But as you can see in each pic - the field is remembering the formatting (i dont know how i got that part to work) - and you can see in the 3rd pic that the formatting is lost when displaying the data
As always - Thanks in advance.
EDIT
In my pics, I am referring to the section on the right - sorry, i have dual screens and didnt realize the screenshot would pick up both screens