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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:08:57+00:00 2026-05-24T20:08:57+00:00

I got problem with JavaScript and Dojo in my Zend Framework project. I got

  • 0

I got problem with JavaScript and Dojo in my Zend Framework project. I got 4 sliders (HorizontalSlider) created by Form in Zend. Every slider get other value and this value i want to display near the sliders. So i got the code in JS:

function getText(){
    var cena = document.getElementById("slider-400")
    var waga = document.getElementById("slider-100")
    var bateria = document.getElementById("slider-700")
    var cale = document.getElementById("slider-1")
    var div = document.getElementById("znajdz-contents")
    div.innerHTML = "Cena : "+(Round(cena.value,2))+" <br/>" + "Waga : "+(Round(waga.value,2))+" <br/>" + "Bateria : "+(Round(bateria.value,2))+" <br/>" + "Wyswietlacz : "+(Round(cale.value,2))+" <br/>"
}

And in form in Zend:

   $this->addElement(
            'HorizontalSlider', 'cena', array(            
        'label' => 'Maksymalna cena',
        'value' => 2000,
        'onchange' =>"getText()"
        'minimum' => 400,
        'maximum' => 2000,          
        'discreteValues' => $discrete,
        'intermediateChanges' => false,
        'showButtons' => false,
        'topDecorationDijit' => 'HorizontalRuleLabels',
        'topDecorationContainer' => 'topContainer',
        'bottomDecorationDijit' => 'HorizontalRule',
        'bottomDecorationContainer' => 'bottomContainer',
        'bottomDecorationLabels' => array(
            '400zł',
            '1200zł',
            '2000zł'
        ),
            )
    );

Changing it to:

$cena->setAttrib('onChange','getText()');

Dont work too. When i delete this lines everything works.
And this work but when i press Submit i got static value for cena – 2000. JS shows good value. Whats wrong? Please help or I die here… :/

  • 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-24T20:08:58+00:00Added an answer on May 24, 2026 at 8:08 pm

    Quick syntax error note: Your function is missing ; at the end of every line. Try this it might help.

    function getText(){
        var cena = document.getElementById("slider-400");
        var waga = document.getElementById("slider-100");
        var bateria = document.getElementById("slider-700");
        var cale = document.getElementById("slider-1");
        var div = document.getElementById("znajdz-contents");
        div.innerHTML = "Cena : "+Round(cena.value,2).ToString()+" <br/>" + 
                        "Waga : "+Round(waga.value,2).ToString()+" <br/>" + 
                        "Bateria : "+Round(bateria.value,2).ToString()+" <br/>" + 
                        "Wyswietlacz : "+Round(cale.value,2).ToString()+" <br/>";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a problem concerning the javascript this keyword when used within a javascript
Hey everyone I got a javascript problem I can't seem to find a specific
I've got a problem with System.Windows.Forms.WebBrowser On every machine, with the exception of one,
I've got a problem controlling a quicktime movie from javascript. I am embedding a
I am working on a small project and i have got a problem. If
Problem I've got a number of Dojo components on a page. When the user
I've got a form on the html page which gets submitted by javascript in
I've got a weird maths/rounding problem in Javascript. The snippet below is a very
Ive got a really strange problem with some javascript code that ive written. I
Okay so I've got a little problem with combining my own Javascript with the

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.