 |
BOOK: Beginning ASP.NET 4 : in C# and VB
 | This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

December 9th, 2010, 05:01 PM
|
Registered User
|
|
Join Date: Dec 2010
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
after adding Javascript on page 312 get error:object expected
for some reason this code is not working for me...I get "Error:Object expected"
do you see an error?
Code:
<script type= "text/javascipt">
function ValidatePhoneNumbers (source, args)
{
var phoneHome = document.getElementByID('<%= PhoneHome.ClientID %>');
var phoneBusiness = document.getElementById('<%= PhoneBusiness.ClientID %>');
if (phoneHome.value !='' || phoneBusiness.value !='')
{
args.IsValid = true;
}
else
{
args.IsValid = false;
}
}
</script>
|

December 9th, 2010, 06:07 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
Take a look at how you spell getElementById. In one line you use getElementByID, and in the other you use getElementById. It should be getElementById.
Hope this helps,
Imar
|

December 9th, 2010, 06:08 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Also, it's
<script type="text/javascript">
instead of
<script type= "text/javascipt">
Cheers,
Imar
|
The Following User Says Thank You to Imar For This Useful Post:
|
|

December 10th, 2010, 01:33 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Haha, I noticed you deleted your previous message. I guess you figured out its Id, not id... ;-) Darn case-sensitive languages.....
Cheers,
Imar
|
The Following User Says Thank You to Imar For This Useful Post:
|
|

December 10th, 2010, 02:38 PM
|
Registered User
|
|
Join Date: Dec 2010
Posts: 2
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
thanks .. i really appreciate your help....love the book.
|
|
 |
|