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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:54:39+00:00 2026-06-18T10:54:39+00:00

Site: http://tinyurl.com/ah9hkgz Issue: I’m trying to write simple javascript function to calculate subtotals and

  • 0

Site:

http://tinyurl.com/ah9hkgz

Issue: I’m trying to write simple javascript function to calculate subtotals and totals of order for customer. I got arrows to increment/decrement values for each product.

Tried to write function cash(qty); that is called onclick together with other “inline javascript” codes. On site, only first product’s UP arrow is calling cash function.

When function cash is called, the document.getelementbyid('szett_subtotal').Value=price; doesn’t work.

cash function:

function cash(qty)
{
   var price = 0;
   price = 12990 + ((qty.value-1)*9990); 
   document.getelementbyid('szett_subtotal').Value=price;
)

Thanks for your help. I hope.

Clarification

Down button does not contain this cash function call because I am focusing on up button for test purpose.

  • 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-18T10:54:40+00:00Added an answer on June 18, 2026 at 10:54 am

    Your function declaration of cash causes a parse error:

    function cash(qty)
    {
       var price = 0;
       price = 12990 + ((qty.value-1)*9990); 
       document.getElementById('szett_subtotal').value=price; 
    )
    ^
    Uncaught SyntaxError: Unexpected token )
    

    Function body should end with a curly end brace }.

    Also, don’t use inline JavaScript code, it’s error prone and adding behaviour from outside the HTML is preferred, such as .addEventListener().

    The easiest to do is create a click handler function and call that from inline:

    function inc_quantity(v)
    {
      var qty_el = document.getElementById(v);
      var qty = qty_el.value;
      if( !isNaN( qty )) qty_el.value++;
      cash(qty_el);
    }
    
      ... onclick="inc_quantity('quantity_szett')"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On my web site, http://tinyurl.com/yhvj6g Why is it that Internet Explorer is placing my
On this site: http://tinyurl.com/2allkcs The submit button for the login form doesn't seem to
@ http://tinyurl.com/6mjd2nj I have a site that was just moved to a new server
Take a look at this site http://tinyurl.com/xhrexample and pick a size in the select
The site http://openbook.etoro.com/#/main/ has an live feed what is generated by javascript via XHR
The site: http://tinyurl.com/358lh6a I want to revalidate the palace address (domain they are wanting,
Check the site: http://tinyurl.com/caljnqb I'm using font-face: @font-face { font-family: 'SegoeUI'; src: url('{site_url}themes/site_themes/agile_records/fonts/segoeui.eot?') format('eot'),
Site: http://partsconsign.com/parts/?custid=1 I don't know what happened. All of a sudden, without changing the
On my site: http://alsite.com.br/solalev/ I have some elements on the bottom of page that
When I open my site http://www.gestaoeventos.com on Defy (Android 2.1 update 1 Browser version

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.