Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7679913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:59:19+00:00 2026-05-31T17:59:19+00:00

I have a component that used to work (Without setting HTML tags to the

  • 0

I have a component that used to work (Without setting HTML tags to the description) and now after trying to get the HTML formatting to work it won’t save.

com_lot\views\lot\tmpl\form.php:

<?php defined('_JEXEC') or die('Restricted access');
$document =& JFactory::getDocument();
$document->addScript('includes/js/joomla.javascript.js');
require_once(JPATH_ADMINISTRATOR .DS. 'components' .DS. 'com_jce' .DS. 'helpers' .DS. 'browser.php');
?>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
   var form = document.adminForm;
   if (pressbutton == 'cancel') {
      submitform( pressbutton );
      return;
   }

   <?php
      $editor =& JFactory::getEditor();
      echo $editor->save( 'description' );
   ?>
   submitform(pressbutton);
}
</script>
...
      <tr>
         <td width="100" align="right" class="key">
            <label for="description">
               <?php echo JText::_( 'Description' ); ?>:
            </label>
         </td>
         <td>
            <?php
               $editor =& JFactory::getEditor();
               echo $editor->display('description', $this->lotdata->description, '550', '400', '60', '20', false);
            ?>
         </td>
      </tr>
...
<input type="hidden" name="option" value="com_lot" />
<input type="hidden" name="lotid" value="<?php echo $this->lotdata->lotid; ?>" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="controller" value="lot" />

<?php echo JHTML::_( 'form.token' ); ?>
<button type="button" onclick="submitbutton('save')"><?php echo JText::_('Save') ?></button>
<button type="button" onclick="submitbutton('cancel')"><?php echo JText::_('Cancel') ?></button>
</form>

com_lot\models\lot.php:

   function store($data)
{
   // get the table
   $row =& $this->getTable();

   // Bind the form fields to the hello table
   if (!$row->bind($data)) {
      $this->setError($this->_db->getErrorMsg());
      return false;
   }

   // Make sure the hello record is valid
   if (!$row->check()) {
      $this->setError($this->_db->getErrorMsg());
      return false;
   }

   // Store the web link table to the database
   if (!$row->store()) {
      $this->setError( $row->getErrorMsg() );
      return false;
   }

   return true;         
}

   function save()
   {
   // Check for request forgeries
   JRequest::checkToken() or jexit( 'Invalid Token' );

   // get the model
   $model =& $this->getModel();

   //get data from request
   $post = JRequest::get('post');
   $post['description'] = JRequest::getVar('description', '', 'post', 'string', JREQUEST_ALLOWRAW);

   // let the model save it
   if ($model->store($post)) {
      $message = JText::_('Success');
   } else {
      $message = JText::_('Error while saving');
      $message .= ' ['.$model->getError().'] ';
   }
   $this->setRedirect('index.php?option=com_lot', $message);
}

Any help appreciated.

Edit: I have seen stuff about JForms and having XML files… is this applicable? I haven’t found anywhere that says what they’re used for, just what types there are…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:59:21+00:00Added an answer on May 31, 2026 at 5:59 pm

    I found the problem (once I’d cleaned up the code a bit) was that in the article I was following (http://docs.joomla.org/How_to_use_the_editor_in_a_component) missed changing store() to store($data).

    Because the pages redirect etc it doesn’t die and error out. Thanks to for Jan for your help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a 32 bit COM component that is used mostly by ASP, we
I have been tasked with refactoring some components that used xmlbeans to now make
I found out after a while that a component used on my website had
I have an .ashx component that is used by a couple of pages, and
I have a component that I hand over a function public var func :
I have a component that is made up of various components such as a
I have a component that i want to store to an SQLite database. public
I have a component that has a sub-component they both use a shared variable
I have a visual component that I built from a TFrame (but then registered
I have a DataGrid component that displays a few columns of data. It has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.