Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-24-2008, 02:46 AM   PM User | #1
Navigator
New Coder

 
Join Date: Mar 2008
Location: A large mitten
Posts: 34
Thanks: 1
Thanked 0 Times in 0 Posts
Navigator is an unknown quantity at this point
Firefox/IE errors

I have a code for my paginator that allows users to just type a page number to go to. (below)

Code:
function pgntr_jump_to_page()
{
	var max_pages = document.getElementById('max_pages');
	var pgntr_url = document.getElementById('pgntr_url');
	var set_pages = document.getElementById('pgntr_set');
	
	if(set_pages.value <= max_pages.value && set_pages.value > 0)
	{
		document.location = pgntr_url.value + set_pages.value;
		document.getElementById('pagei_jump_box').style.display = 'none';
	}
	else
	{
		var a = confirm("The page number you entered is invalid, it must be between 0 and " + max_pages.value);
		
		if(a == false)
		{
			document.getElementById('pagei_jump_box').style.display = 'none';
		}
	}
}
This issues are as follows:

IE: In internet explorer the code works up to one point when you actually check that the number is valid. If it's less than 0 it works and displays the confirmation box, but if it's greater than the max number of pages it will take you to that page still. I don't get that little "error" symbol on the bottom left. So the code is right in syntax, just not how I want it to work.

Fire Fox: The issue with fire fox is that when you click "Go" on the pop-up id does nothing, no redirection, no confirmation box. I am guess that has to do with the document.getElementById things.

I am not sure how to fix these errors, I have been at it for the past two or more hours.
Navigator is offline   Reply With Quote
Old 11-24-2008, 06:23 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,689
Thanks: 158
Thanked 2,184 Times in 2,171 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
We need your html also to test the code at our end. Or a link would be better.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:32 AM.


Advertisement
Log in to turn off these ads.