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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:27:09+00:00 2026-06-17T16:27:09+00:00

i tried to set up a onclick function on a reset button type, which

  • 0

i tried to set up a onclick function on a “reset” button type, which will only work if i click it twice, i’ve even tried it as a normal button type with the same results. I’ve placed it on other parts of the site but the same results persists.

The functions it does is that it erases out text that appears dynamically everytime you add a new order. And the html reset functions wipes out the rest of the sites input, which is ok i guess.

Here you can visit the website and see for yourself:

http://www.premiere-produkter.no/pp/lagersalg/index.php

Here is a part of the code,

var tester;
var tester = function () {
    document.form['reset'].onclick = function () {
        contact_box_kurv.innerHTML = ("").replace (/,/g, ''); 
        return false;
    };
};
</script>

<h2><INPUT TYPE="RESET" name="reset" id="reset" VALUE="Tøm Handlekurv" onclick="tester()"></h2>

Note: To see the function work on the website you will need to add an order.

  • 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-17T16:27:10+00:00Added an answer on June 17, 2026 at 4:27 pm

    Your button has an inline onclick attribute that calls tester(). So on first click it’ll do whatever tester() does – which is replace that with another onclick set to the anonymous function inside tester(). So then on second click it’ll do what that second anonymous function does.

    Try this instead:

    var tester = function () {
        contact_box_kurv.innerHTML = ("").replace (/,/g, ''); 
        return false;
    };
    

    (I.e., have the desired functionality directly in tester().)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a reset button which on click will set all select
<input id=UploadButton type=button value=Upload onclick=xyz/> <script language=javascript type=text/javascript> $(function () { $().SPServices({ operation: GetList,
I tried using the code below to set up a contextmenu which only displays
I have a button on a page with an onClick I dynamically set via
I have the following Javascript code which controls an accordion type set of divs.
I tried to set the tick style to tsManual, the min and max position
I tried to set the background color of a data grid view to be
I tried to set the usergent using Inet1.Execute , GET, Referer: yahoo.com & vbCrLf
I tried to set up the date_select in my HAML template for displaying just
I tried to set up my togglebutton properties layout using style.xml. Here's my code:

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.