Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Object dosnt support this property or method?
Old 11-05-2010, 12:04 PM Object dosnt support this property or method?
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 961
Name: Darren
Location: England
Trades: 0
I am using this piece of code and Windows debug comes up with an error for:
form = document.getElementById('form');

The code seems to work in all browsers apart from IE?


Code:
<script language="javascript">
$(document).ready(function() {
	
	var loading;
	var results;
	
	form = document.getElementById('form');
	loading = document.getElementById('loading');
	results = document.getElementById('results');
	
	$('#Submit').click( function() {
		
		if($('#Search').val() == "")
		{alert('please enter a domain');return false;}
		
		results.style.display = 'none';
		$('#results').html('');
		loading.style.display = 'inline';
		
		$.post('process.php?domain=' + escape($('#Search').val()),{
		}, function(response){
			
			results.style.display = 'block';
			$('#results').html(unescape(response));	
			loading.style.display = 'none';
		});
		
		return false;
	});
	
});
</script>
__________________
I Just a test to see what happens...
Please login or register to view this content. Registration is FREE

"Let us be thankful for the fools. But for them the rest of us could not succeed..."
rolda hayes is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-26-2010, 12:06 PM Re: Object dosnt support this property or method?
alexsts's Avatar
Novice Talker

Posts: 14
Name: Alex
Location: USA
Trades: 0
try to use other then "form" as id for your form....
FORM is a reserved word for IE.
alexsts is offline
Reply With Quote
View Public Profile
 
Old 11-29-2010, 06:50 AM Re: Object dosnt support this property or method?
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 961
Name: Darren
Location: England
Trades: 0
Here is a simplified version of the page

As I said, it seems to work in all but Internet Explorer although I'm wondering if there may be a CSS problem as well that is causing it...
__________________
I Just a test to see what happens...
Please login or register to view this content. Registration is FREE

"Let us be thankful for the fools. But for them the rest of us could not succeed..."
rolda hayes is offline
Reply With Quote
View Public Profile
 
Old 11-29-2010, 07:42 AM Re: Object dosnt support this property or method?
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
As alexsts said, the problem is the line form = document.getElementById('form');"form" is a reserved word - change it to my_form or whatever.
PaulW is online now
Reply With Quote
View Public Profile
 
Old 11-29-2010, 08:07 AM Re: Object dosnt support this property or method?
rolda hayes's Avatar
Wannabe Adventurer...

Posts: 961
Name: Darren
Location: England
Trades: 0
Sorry, I should have read post 2 better!
I was changing the <form> name...

Changed the document.getElementById and it works fine now.

Cheers!
__________________
I Just a test to see what happens...
Please login or register to view this content. Registration is FREE

"Let us be thankful for the fools. But for them the rest of us could not succeed..."
rolda hayes is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Object dosnt support this property or method?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.16957 seconds with 12 queries