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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:18:24+00:00 2026-06-09T20:18:24+00:00

So when I click the add button it checks to see if there is

  • 0

So when I click the add button it checks to see if there is text in the input field and then it creates a div for it and then adds +1 to the counter. The problem is the counter; it only adds +1 and then does nothing when clicked again. When I delete a div it does -1 just fine. So yeah, won’t go past 1 or -1.

site:

http://web-owl.com/todo/

The function:

 function validateForm() 
            {
                var x=document.forms["forming"]["texting"].value;
                if (x==null || x=="")
                {
                alert("Get it together! You need to have text in there!");
                return false;
                } 
                else 
                {

            var clone = $('#theDiv')
                .clone()
                .attr('id','')
                .show()
                .append(
                $('<div>').html(
                $('#textI2').val()
                ).addClass('futureEditor')
                 );
                $('#hold').append(clone)
                var x = 0;
            x += 1;
            document.getElementById( "clicked" ).value = x;
              return false;
              }

            }

Clicked link:

<form id="forming" name="forming"  onsubmit="return validateForm()" method="post">

Counter:

<p>You have <input id="clicked" size="3" onfocus="this.blur();" value="0" > Stuffs. </p>
  • 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-09T20:18:26+00:00Added an answer on June 9, 2026 at 8:18 pm

    Make your count variable global

    var count = 0;
    function validateForm() {
        var x = document.forms["forming"]["texting"].value;
        if (x == null || x == "") {
            alert("Get it together! You need to have text in there!");
            return false;
        }
        else {
    
            var clone = $('#theDiv').clone().attr('id', '').show().append(
            $('<div>').html(
            $('#textI2').val()).addClass('futureEditor'));
            $('#hold').append(clone)
            count++;
            document.getElementById("clicked").value = count;
            return false;
        }
    
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I click on Add button , the formAddNewRow form opens , but I
Is it possible to add button click event by clicking design of axml? if
Project: http://design.vitalbmx.com/fave/news.html When I click Add to favorites button (under main pic), in Chrome
Take the example I have setup at http://jsfiddle.net/vEF6y/ Click on the 'add item' button
In Axapta, How to add a button to a dialog and intercept the click
I am trying to click a button and add a resistor. So what I
On a click of a button named Add Textbox it calls a function which
I want to add a click able button to a MKAnnotation as seen in
I managed to write add program that upon the user click a button, he
I want to add a ZedGraph when I click a button, but the ZedGraph

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.