Solved

True or False values for JavaScript validations

Posted on 2009-04-10
4
175 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
[X]
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
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

I. Introduction In a previous article (http://www.experts-exchange.com/Web_Development/Document_Imaging/A_6537-PaperPort-Upgrade-How-to-download-and-install-updated-versions-of-PaperPort-11-and-12.html) (now deprecated), I discussed how to upgrad…
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
This video demonstrates how to use each tool, their shortcuts, where and when to use them, and how to use the keyboard to improve workflow.
In this Micro Tutorial viewers will learn the basic shortcuts and functions in InDesign.

630 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