Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


True or False values for JavaScript validations

Posted on 2009-04-10
Medium Priority
Last Modified: 2012-05-06
What does the following code mean?
on click (if the button was not clicked?), is this contradicting itself?

<a href="#" ID="btnCalculate" NAME="btnCalculate" onclick="if(clicked == 0){CalculateAllPayments()}">

Question by:Faye_DBA
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 41

Expert Comment

ID: 24118055
anchor tags (i.e., "a") don't have a clicked attribute.  So, I think that this reference to "clicked" is to a global variable.
LVL 41

Accepted Solution

HonorGod earned 2000 total points
ID: 24118079
Yeah, this demonstrates it.

Change the value of "clicked" to true, or false, and click on the "here' link
<script type='text/javascript'>
var clicked = false
<a href="#" onclick="alert(clicked)">here</a>

Open in new window


Author Comment

ID: 24118090
You are correct because I found the variable that sets the value of clicked on formsubmit()

function frmPayments_onsubmit()
      clicked = 1;


LVL 41

Expert Comment

ID: 24118124
Thank you for the grade & points.

Good luck & have a Happy Easter.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article was inspired by a question here at Experts Exchange ( The requirements stated in that question are (1) reduce the file size of a large number of…
When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
The goal of the tutorial is to teach the user how to use the cropping tool and to straighten there photos so it does not look tilted. You will choose which photo you want to edit, crop it to you liking and make it straight.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question