Page error duplicating Joe Stangler's sample HTML page. . . ?

J

Jim

Hi,

I was watching one of Joe Stangler's asp videos and he started with using
HTML controls and a line of javascript. I think I've duplicated the page
correctly but the browser is saying that there is a semi-colon at line 22,
char 8. I don't know why it needs a semi-colon on line 22. The result is
that the control called HTMLButton doesn't update the specified label. You
should be able to throw this into a page and see the error yourself.

Can anyone scrutinize this snippet and tell me what I've done wrong? Thanks
alot! Jim M.

'**********************************************
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<meta content = "text/html; charset = utf-8" http-equiv = "Content-Type" />

<script language = "javascript" type ="text/javascript">

// <!CDATA[

function HTMLButton_click() {

document.getElementById('Label1').innertext = "Hey, text from HTML button";

}

//]>


</script>

<head>

<title>Test Page</title>

</head>

<body>

<form method ="post" action = "http://www.microsoft.com">

<input name = "text1" type = "text"/>

<br /> <br />

<label id = "Label1">Temp Value</label>

<br /> <br />

<input name = "HTMLButton" type = "button" value ="Click me for a suprise!"
onclick = "Return HTMLButton_click()" />

<br /><br />

<input id="SubmitForm" type="submit" value="Click to Submit" />


</form>


</body>

</html>

'**********************************************
 
S

Scott M.

JavaScript is a case-sensitive language, the word "innertext" should be
"innerText" and in your button's code, you've written "Return", which should
be "return".

-Scott
 
J

Jim

Thanks alot! I knew it had to be some elusive little quirks like that!

Scott M. said:
JavaScript is a case-sensitive language, the word "innertext" should be
"innerText" and in your button's code, you've written "Return", which
should be "return".

-Scott


Jim said:
Hi,

I was watching one of Joe Stangler's asp videos and he started with using
HTML controls and a line of javascript. I think I've duplicated the page
correctly but the browser is saying that there is a semi-colon at line
22, char 8. I don't know why it needs a semi-colon on line 22. The
result is that the control called HTMLButton doesn't update the specified
label. You should be able to throw this into a page and see the error
yourself.

Can anyone scrutinize this snippet and tell me what I've done wrong?
Thanks alot! Jim M.

'**********************************************
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<meta content = "text/html; charset = utf-8" http-equiv = "Content-Type"
/>

<script language = "javascript" type ="text/javascript">

// <!CDATA[

function HTMLButton_click() {

document.getElementById('Label1').innertext = "Hey, text from HTML
button";

}

//]>


</script>

<head>

<title>Test Page</title>

</head>

<body>

<form method ="post" action = "http://www.microsoft.com">

<input name = "text1" type = "text"/>

<br /> <br />

<label id = "Label1">Temp Value</label>

<br /> <br />

<input name = "HTMLButton" type = "button" value ="Click me for a
suprise!" onclick = "Return HTMLButton_click()" />

<br /><br />

<input id="SubmitForm" type="submit" value="Click to Submit" />


</form>


</body>

</html>

'**********************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top