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 8426941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:39:58+00:00 2026-06-10T04:39:58+00:00

I managed to include latexrender (http://www.mayer.dial.pipex.com/tex.htm) into my new Zend Framework based project and

  • 0

I managed to include latexrender (http://www.mayer.dial.pipex.com/tex.htm) into my new Zend Framework based project and everything seems to be working fine except the ajax-based preview strips “+” sign from my formulas for some reason.

Here’s my html fragment with example textarea:

<dt id="formula-label"><label for="formula" class="required">Formula:</label></dt>
<dd id="formula-element">
<textarea name="formula" id="formula" rows="5" cols="40"></textarea>
<p class="description"><span class="preview-formula"></span></p></dd>

<button name="previewtformula" id="previewformula" type="button" onclick="generatePreview(&#39;formula&#39;)">Preview</button>

Here’s the corresponding Zend form code:

    $formula = $this->createElement('textarea', 'formula');
    $formula->setLabel('Formula:');
    $formula->setRequired(true);
    $formula->setAttrib('rows', 5);
    $formula->setAttrib('cols', 40);
    $formula->setDescription('<span class="preview-formula"></span>');
    $formula->getDecorator('Description')->setEscape(false);
    $this->addElement($formula);

    $prevFormula = $this->createElement('button', 'preview-formula');
    $prevFormula->setAttrib('onclick', "generatePreview('formula')");
    $prevFormula->setLabel('Preview');
    $prevFormula->removeDecorator('DtDdWrapper');
    $this->addElement($prevFormula);

javascript file:

function generatePreview(elem){
    var details = $('textarea#'+elem).val();

    $.ajax({
        type: 'POST',
        url: '/formula/preview',
        async: false,
        data: 'details=' + details,
        success: function(responseText) {

            $("span.preview-"+elem).html(responseText);

        }
    });
};

and my controller action:

public function previewAction() {

   if($this->_request->isXmlHttpRequest()) {
                $this->_helper->viewRenderer->setNoRender();
                $this->_helper->Layout->disableLayout();
                $data = $this->_request->getPost();
                $latex = new My_LatexRender();
                echo nl2br($latex->latex_content($data['details']));
        } else {
            return $this->_redirect('/index');
        }
}

like I said everything is working fine, the images are saving to the disk nicely and formulas added to the database are intact (there are “+” signs) but when i preview the formulas it somehow got strip from all “+” signs so for example

“2+2” saves in database as “2+2” but in preview it’s just “22”

not sure if there are other characters stripped, haven’t noticed any so far

  • 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-06-10T04:40:00+00:00Added an answer on June 10, 2026 at 4:40 am

    i found solution. i had to change

    data: 'details=' + details,
    

    to

    data: {details: details},
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I managed to apply this excellent example to my needs: http://code.google.com/p/galleriffic/issues/attachmentText?id=76&aid=-3045121742886940548&name=example-2.html&token=4nlvmgAfVpc5whcXC9UEqHZaSz0%3A1339257750721 With a small
I have this managed bean: package com.DX_57.SR_57; /** include default packages for Beans */
We have a geeklog managed site running at http://bhaa.ie We recently setup a zend
I am new to making WordPress themes but I have managed to include the
The Managed Extensibility Framework (MEF) and Managed AddIn Framework (MAF, aka System.AddIn) seem to
I have to include a (managed) C++/CLI component in one of my ASP.NET projects,
I'm trying ton include some JSF into my webapp. For the components lib I've
I've read the various authorities on this, include Dewhurst and yet haven't managed to
With the following Store and Service models, managed with MongoMapper: class Store include MongoMapper::Document
I'm new to managed C++. I have two managed C++ projects in a single

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.