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

  • Home
  • SEARCH
  • 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 9021235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:12:29+00:00 2026-06-16T05:12:29+00:00

Please see the <?php if($_POST[‘submit’]) { $beg=$_POST[‘basic’]; } if($_POST[‘inter’]) { $int=$_POST[‘int’]; } if($_POST[‘advance’]) {

  • 0

Please see the

<?php
if($_POST['submit'])
{
$beg=$_POST['basic'];
}

if($_POST['inter'])
{
$int=$_POST['int'];
}

if($_POST['advance'])
{
$adv=$_POST['adv'];
}
?>

function refreshPrices() {

   var beg=<?php echo $beg; ?>;
   var inte=<?php echo $int; ?>;
   var advn=<?php echo $adv; ?>;


    var currentTotalValue = 0;
    currentTotalValue = currentTotalValue + parseInt(beg) + parseInt(inte) + parseInt(advn);
    $("#results div").each(function() {
        if (!isNaN(parseInt($(this).find("span").text().substring(1)))) {
            currentTotalValue += parseInt($(this).find("span").text().substring(1));
        }
    });


    $("#totalValue").text("$" + currentTotalValue)
}

If I add one variable from php and add them to current total in jQuery function, it is working fine, but if I add 3 variables and them to jQuery total it is not working. In my html I have 3 buttons with different hidden values just to post them to second page what ever the value it will be added to jQuery total.

  • 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-16T05:12:30+00:00Added an answer on June 16, 2026 at 5:12 am

    The reason why it does not work is simple. You create invalid javascript.

    Let’s say $int = null; in that case echo $int; will print nothing and var inte = ; is not valid, so it “won’t work”. And as long $int and other variables are user input the results can be worse. So first of all validate your input and also have default values so that in content you had valid javascript.

    var beg=<?php echo (is_string($beg)) ? $beg : defaultValue; ?>;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm noticing some strange results with date conversions between MYSQL and PHP. Please see
Basically my problem is with the page at http://wiki.diablocommunity.com/index.php?title=Tristram_Cathedral Please see the screen shots
Please see below code: thrust::device_vector<int>::iterator whereToBegin = copyListOfNgramCounteachdoc.begin(); end = thrust::unique_by_key(end.first, end.first + numUniqueNgrams,end.second);
Please see the code snippet below : #include <iostream> using namespace std; int main()
Please see my question in the template section below: Form (showSuccess): <?php echo form_tag('job/salarySubmit')
Update: Please see below; I have removed all abstraction and created a plain PHP
test.html <html> <!-- Please see the full php-ajax tutorial at http://www.php-learn-it.com/tutorials/starting_with_php_and_ajax.html If you found
Please see this example: if (strlen($_SESSION['userDetails']['THISNAME']) == 0) { $_SESSION['userDetails'][''.$THISNAME.'Error'] = autofocus; include $docRoot/html/forms/reg/user_info.html.php;
Please see demo here: http://jsfiddle.net/mA6qm/1/ (expand console) Why aren't events being sent or received
Please see here , at the end of the post, the 70px author image

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.