True or False values for JavaScript validations

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()}">

Who is Participating?
HonorGodSoftware EngineerCommented:
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

HonorGodSoftware EngineerCommented:
anchor tags (i.e., "a") don't have a clicked attribute.  So, I think that this reference to "clicked" is to a global variable.
Faye_DBAAuthor Commented:
You are correct because I found the variable that sets the value of clicked on formsubmit()

function frmPayments_onsubmit()
      clicked = 1;


HonorGodSoftware EngineerCommented:
Thank you for the grade & points.

Good luck & have a Happy Easter.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.