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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:48:49+00:00 2026-05-31T11:48:49+00:00

I try again to ask my question. I hope that this time it’s clear

  • 0

I try again to ask my question. I hope that this time it’s clear enough.

Here’s the live demo of my script:
http://www.virusgaming.net/test/

And this is the code:

<? // I set the starting percentage to 0%. 
$something = 0; ?>      

<!-- jsProgressBarHandler prerequisites : prototype.js -->
<script type="text/javascript" src="js/prototype/prototype.js"></script>

<!-- jsProgressBarHandler core -->
<script type="text/javascript" src="js/bramus/jsProgressBarHandler.js"></script>        

<span style="color:#006600;font-weight:bold;">Multi Color Bar</span> <br/>
<span id="element6">Loading...</span>
<span class="extra"><a href="#" onclick="manualPB2.setPercentage('0', true);return false;"><img src="images/icons/empty.gif" alt="" title="" onmouseout="$('Text6').innerHTML ='&laquo; Select Options'" onmouseover="$('Text6').innerHTML ='Empty Bar'"/></a></span>
<span class="options"><a href="#" onclick="manualPB2.setPercentage('+10');return false;"><img src="images/icons/add.gif" alt="" title="" onmouseout="$('Text6').innerHTML ='&laquo; Select Options'" onmouseover="$('Text6').innerHTML ='Add 10%'"/></a></span>
<span class="options"><a href="#" onclick="manualPB2.setPercentage('-5');return false;"><img src="images/icons/minus.gif" alt="" title="" onmouseout="$('Text6').innerHTML ='&laquo; Select Options'" onmouseover="$('Text6').innerHTML ='Minus 5%'" /></a></span>
<span class="options"><a href="#" onclick="manualPB2.setPercentage('30');return false;"><img src="images/icons/set.gif" alt="" title="" onmouseout="$('Text6').innerHTML ='&laquo; Select Options'" onmouseover="$('Text6').innerHTML ='Set 30%'"/></a></span>
<span class="options"><a href="#" onclick="manualPB2.setPercentage('98'); manualPB2.setPercentage('30'); return false;"><img src="images/icons/fill.gif" alt="" title="" onmouseout="$('Text6').innerHTML ='&laquo; Select Options'" onmouseover="$('Text6').innerHTML ='Fill 98%, and then 30%'" /></a></span>
<span class="getOption"><a href="#" onclick="alert(manualPB2.getPercentage());return false;"><img src="images/icons/get.gif" alt="" title="" onmouseout="$('Text6').innerHTML ='&laquo; Select Options'" onmouseover="$('Text6').innerHTML ='Get Current %'"/></a></span>
<span id="Text6" style="font-weight:bold">&laquo; Select Options</span>

<script type="text/javascript">                     
    document.observe('dom:loaded', function() {

        manualPB2 = new JS_BRAMUS.jsProgressBar(
                    $('element6'),
                    <? echo $something; ?>,                             
                    {

                        barImage    : Array(
                            'images/bramus/percentImage_back4.png',
                            'images/bramus/percentImage_back3.png',
                            'images/bramus/percentImage_back2.png',
                            'images/bramus/percentImage_back1.png'
                        ),

                        onTick : function(pbObj) {

                            switch(pbObj.getPercentage()) {

                                case 70:
                                    alert('we are at 70%');
                                break;

                                case 100:
                                    alert('we are at 100%');                                        
                                break;                                                                                                                                                                              

                            }

                            return true; 
                        }
                    }
                );
    }, false);
</script>

I want to pass the client-side javascript percentage to server-side php variable. I did tens of tries with GET and POST javascript (hidden fields, forms, anchor, onclick event etc) with no success. Basically with the onclick=”alert(manualPB2.getPercentage()); function i stamp the current percentage in an alert. Is possible edit this alert so that it post/get the variable to php?

  • 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-31T11:48:51+00:00Added an answer on May 31, 2026 at 11:48 am

    Instead of the alert, try this ajax call,

     var url = 'YourServerSideScript.php';
     var pars = 'percentage=' + pbObj.getPercentage(); // you have to use $_POST['percentage'] on your script
     var target = 'targeDivId';
     var myAjax = new Ajax.Updater(target, url, {method: 'post', parameters: pars});
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had another question about this issue, but I didn't ask properly, so here
I don't know how to ask this question thru google, i try but what
my last question was closed because it wasn't clear, so I'll try again because
I’d like to ask you a question again if you have some time. I
I tried to ask this before, and messed up the question, so I'll try
i've asked the first question about selects here , i thought, that when i
I am not sure if StackOverflow is the right service to ask this question
This question has been brought up many times, but I'd like to ask it
I have a question this time around regarding the Android custom camera, NOT the
Did ask a question about the same problem here: Silly problem with UTF8 but

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.