JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 9th, 2008, 11:49 AM
CeroUno CeroUno is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 4 CeroUno User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 9 m 28 sec
Reputation Power: 0
Error, "Object Required"

I'm getting this error by double clicking the warning icon present in IE's window (bottom left). It points to line 36 and "Char 3" whatever that Char 3 means is beyond me.

Has anyone got an idea whats wrong with the following code.

Code:

function __isValidEmailAddr(email)
{
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if (filter.test(email))
		return true;
	else
		return false;
}

function __checkContactForm()
{
	var _name = document.getElementById('name').value;
	var _email = document.getElementById('email').value;
	var _comments = document.getElementBy('comments').value;
	var _errorTrigger = false;
	var _errorMessage = '';
	
	if ( _name = '' )
		{
			_errorTrigger = true;
			_errorMessage += '\n~ You must provide a name';
		}
	else if ( _name.length < 3 )
		{
			_errorTrigger = true;
			_errorMessage += '\n~ You must provide a legitimate name';
		}
	
	if ( __isValidEmailAddr(_email) == false )
		{
			_errorTrigger = true;
			_errorMessage += '\n~ You must provide a real email address';
		}
		
	if ( _comments = '' )
		{
			_errorTrigger = true;
			_errorMessage += '\n~ You must provide a message';
		}
	else if ( _comments.length < 10 )
		{
			_errorTrigger = true;
			_errorMessage += '\n~ You must provide a legitimate message';
		}
		
	if ( errorTrigger == true )
	{
		alert('\nThe following error(s) were discovered prior to form submission.\n' + _errorMessage + '\n\n');
		return false;
	}
	
	delete _name;
	delete _email;
	delete _comments;
	delete _errorTrigger;
	delete _errorMessage;
	
	return true;
	
}


Whilst on the subject, can anyone recommend me a javascript debugger, I've only IE's error messages to go on at the moment.

Reply With Quote
  #2  
Old May 9th, 2008, 01:25 PM
Ebot's Avatar
Ebot Ebot is offline
Meatball Surgeon
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2004
Location: Elbow deep in code
Posts: 1,040 Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Ebot User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)  Folding Points: 10015 Folding Title: Novice Folder
Time spent in forums: 1 Week 3 Days 3 h 37 m 17 sec
Reputation Power: 462
var _comments = document.getElementById('comments').value;

And what is with all the underscores?
__________________
The liver is evil and must be punished!

Reply With Quote
  #3  
Old May 9th, 2008, 01:59 PM
lnxgeek lnxgeek is offline
I AM A GOLDEN GOD
Dev Shed God (5000 - 5499 posts)
 
Join Date: Apr 2003
Location: cannot find symbol: method showLocation()
Posts: 5,278 lnxgeek User rank is Colonel (50000 - 60000 Reputation Level)lnxgeek User rank is Colonel (50000 - 60000 Reputation Level)lnxgeek User rank is Colonel (50000 - 60000 Reputation Level)lnxgeek User rank is Colonel (50000 - 60000 Reputation Level)lnxgeek User rank is Colonel (50000 - 60000 Reputation Level)lnxgeek User rank is Colonel (50000 - 60000 Reputation Level)lnxgeek User rank is Colonel (50000 - 60000 Reputation Level)lnxgeek User rank is Colonel (50000 - 60000 Reputation Level)lnxgeek User rank is Colonel (50000 - 60000 Reputation Level)lnxgeek User rank is Colonel (50000 - 60000 Reputation Level)lnxgeek User rank is Colonel (50000 - 60000 Reputation Level)lnxgeek User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 21 h 17 m 36 sec
Reputation Power: 564
Quote:
Originally Posted by CeroUno
I'm getting this error by double clicking the warning icon present in IE's window (bottom left). It points to line 36 and "Char 3" whatever that Char 3 means is beyond me.


It means the third character on line 36.

Quote:
Originally Posted by CeroUno
Whilst on the subject, can anyone recommend me a javascript debugger, I've only IE's error messages to go on at the moment.


I would suggest developing with Firefox and using either the Venkman JS debugger or (what I personally use) Firebug extensions. You still have to run everything through IE and as many other browsers as you can to make sure your code is relatively browser neutral.
Comments on this post
vbrtrmn agrees!
KorRedDevil agrees!
__________________
BookMooch.com : Give books away. Get books you want.

Reply With Quote
  #4  
Old May 9th, 2008, 02:13 PM
vbrtrmn's Avatar
vbrtrmn vbrtrmn is offline
I <3 Javascript
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2004
Location: Northern Virginia
Posts: 1,775 vbrtrmn User rank is First Lieutenant (10000 - 20000 Reputation Level)vbrtrmn User rank is First Lieutenant (10000 - 20000 Reputation Level)vbrtrmn User rank is First Lieutenant (10000 - 20000 Reputation Level)vbrtrmn User rank is First Lieutenant (10000 - 20000 Reputation Level)vbrtrmn User rank is First Lieutenant (10000 - 20000 Reputation Level)vbrtrmn User rank is First Lieutenant (10000 - 20000 Reputation Level)vbrtrmn User rank is First Lieutenant (10000 - 20000 Reputation Level)vbrtrmn User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 6 Days 21 h 39 sec
Reputation Power: 139
Send a message via ICQ to vbrtrmn Send a message via AIM to vbrtrmn Send a message via MSN to vbrtrmn Send a message via Yahoo to vbrtrmn
I concur with lnxgeek, starting with IE's crap debugging tools is a waste of time. There's actually a Firebug lite, which you can use in IE and Safari to debug with... after you have finished working with Firefox.

http://www.getfirebug.com/lite.html
__________________
------------- vbrtrmn --------------
i think i'm missing some vowels here
------------------------------------
---------- js.antinoc.net ----------
------------------------------------
--- The Two Types of Programmers ---

Reply With Quote
  #5  
Old May 9th, 2008, 10:38 PM
CeroUno CeroUno is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 4 CeroUno User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 9 m 28 sec
Reputation Power: 0
I made some syntax errors that were driving me mad, also I also missed some comparision operators

e.g.

Code:
if ( _name = '' )


instead of

Code:
if ( _name == '' )


Thanks for the suggestions, I've installed those two plugins for firefox, will give them a go.

Note: Has any one/company developed a dedicated IDE for javascript?

Reply With Quote
  #6  
Old May 9th, 2008, 11:00 PM
sarav_dude's Avatar
sarav_dude sarav_dude is offline
php,mysql,js,html,css learner
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2006
Location: Universe ^_^
Posts: 514 sarav_dude User rank is First Lieutenant (10000 - 20000 Reputation Level)sarav_dude User rank is First Lieutenant (10000 - 20000 Reputation Level)sarav_dude User rank is First Lieutenant (10000 - 20000 Reputation Level)sarav_dude User rank is First Lieutenant (10000 - 20000 Reputation Level)sarav_dude User rank is First Lieutenant (10000 - 20000 Reputation Level)sarav_dude User rank is First Lieutenant (10000 - 20000 Reputation Level)sarav_dude User rank is First Lieutenant (10000 - 20000 Reputation Level)sarav_dude User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 2 Weeks 3 Days 16 h 37 m 10 sec
Reputation Power: 178
Send a message via Yahoo to sarav_dude Send a message via Google Talk to sarav_dude
Quote:
Originally Posted by vbrtrmn
There's actually a Firebug lite, which you can use in IE and Safari to debug with... after you have finished working with Firefox.

http://www.getfirebug.com/lite.html


hi,

i have used that too, but it just shows the same error information as the IE's crap debugging tools ...



so its always a pain to debug in IE
__________________
Planning is pain if the requirements are not clear
--
mod_rewrite
url saving application

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Error, "Object Required"


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway