Solved

True or False values for JavaScript validations

Posted on 2009-04-10
4
167 Views
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()}">

Thanks
0
Comment
Question by:Faye_DBA
  • 3
4 Comments
 
LVL 41

Expert Comment

by:HonorGod
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.
0
 
LVL 41

Accepted Solution

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

Change the value of "clicked" to true, or false, and click on the "here' link
<html>

<body>
 

<script type='text/javascript'>

var clicked = false

</script>
 

<a href="#" onclick="alert(clicked)">here</a>
 

</body>

</html>

Open in new window

0
 

Author Comment

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

function frmPayments_onsubmit()
{
      clicked = 1;

...............

Thanks
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 24118124
Thank you for the grade & points.

Good luck & have a Happy Easter.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In a previously published article (http://www.experts-exchange.com/articles/10331/Automatic-Duplex-Scanning-in-PaperPort-Versions-11-12-14.html) here at Experts Exchange, I explained how to achieve duplex (double-sided) scanning in Nuance's PaperPor…
PaperPort 14.5 Patch 1 update is often not detected or downloaded automatically. This article provides direct download links to solve the problem for retail (non-bundled) versions of the Standard and Professional editions, as well as the Professiona…
The goal of the tutorial is to teach the user how to add a water mark to there photo. Once you have a photo you like you have to go into the water mark setting and add a water mark to the image. You can either choose a text watermark or an image…
The goal of the tutorial is to teach the user how to remove a natural vignette your photos and how to add vignette to your photos.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now