By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,730 Members | 1,648 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,730 IT Pros & Developers. It's quick & easy.

A simple IF statement

P: n/a
FP
I think I've been staring at the computer screen too long.
Below is the exact code of my HTML page. If I uncomment the "If"
statement in the def function then I don't see the "abc" alert. Am I
writing the "If" statement incorrectly?
<SCRIPT LANGUAGE="JavaScript">
function def(){
//If(1 == 2){
//return false;
//}
}

function abc(){
alert('abc');
return false;
}
</script>
<HTML>
<BODY>
<FORM ACTION="list.php" METHOD=POST onsubmit="return abc();">
<table>
<TR>
<TD>
<INPUT TYPE=submit NAME="Submit" VALUE="Continue">
</TD>
</TR>
</TABLE>
</FORM>
</BODY>
</HTML>

Jul 21 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
FP wrote:
//If(1 == 2){
"if"
--
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"
Jul 21 '06 #2

P: n/a

John W. Kennedy wrote:
FP wrote:
//If(1 == 2){

"if"
--
John W. Kennedy
"The blind rulers of Logres
Nourished the land on a fallacy of rational virtue."
-- Charles Williams. "Taliessin through Logres: Prelude"
Hi,

Javascript is case-sensitive so that won't work use "if".

JAVAScritp != javascript but javascript == javascript :)

Jul 21 '06 #3

P: n/a
FP
Thanks, I thought I was starting to loose it.

Jul 21 '06 #4

P: n/a

FP wrote:
Thanks, I thought I was starting to loose it.
no worries this happens.

Jul 21 '06 #5

P: n/a
amit said the following on 7/21/2006 2:06 PM:
John W. Kennedy wrote:
>FP wrote:
>> //If(1 == 2){
"if"

<snipped signature>

Don't quote signatures.
Hi,

Javascript is case-sensitive so that won't work use "if".
What exactly do you think the point of John's post was?
JAVAScritp != javascript but javascript == javascript :)
Javascript is spelling sensitive as well.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jul 21 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.