Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2008
    A large mitten
    Thanked 0 Times in 0 Posts

    Firefox/IE errors

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

    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';
    		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.

  2. #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Thanked 2,233 Times in 2,220 Posts
    We need your html also to test the code at our end. Or a link would be better.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts