Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 3 of 3 FirstFirst 123
Results 31 to 43 of 43
  1. #31
    New Coder
    Join Date
    May 2011
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dear SB65,
    The datepicker is ok working well showing at the right location under input box. The thing why I stick to this tab still is because I have done a lot of pages of coding already so I have to do a lot of rework. On top of that also because of its style. I have done the coding in the validation to show the right tab but is not highlighting the the right tab. But from the php code representing the tabs as below it highlight the right tab but from my javascript validateForm it does not highlight the right tab. This is my only problem I am lost because the same function work well when called from php but not from another javascript function.

    Code:
    $kts->addTab("root","Driver Details","Driver Details","javascript:showTab(\"driverDetails\")",$driverDetails);
    		$kts->addTab("root","Driver Licenses","Driver Licenses","javascript:showTab(\"driverLicenses\")",$driverLicenses);
    		$kts->addTab("root","Driver Employment","Driver Employment","javascript:showTab(\"driverEmployment\")",$driverEmployment);

  2. #32
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Datepicker is not under the input box in FF, however, fair enough.
    The problem is with your validation code I think - the conditions to switch the tabs in your javascript are not met.

  3. #33
    New Coder
    Join Date
    May 2011
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dear SB65,
    Yes thank you I saw it in FF is not appearing well but why in IE is ok. What could be the cause ya? What else do you think I should include in my validation code to enable the switching to happen. I dont understand why the showTab function works well when call from the php but not from validateForm function? Quite weird right?

  4. #34
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    What could be the cause ya?
    I'd suggest validating your code and adding a valid doctype. IE may be displaying what you want but it isn't displaying correctly.

    I dont understand why the showTab function works well when call from the php but not from validateForm function? Quite weird right?
    Not necessarily. The showTab I'm sure works fine, but the conditions required in your javascript to call showTab are not met - so I think the problem is in your validation javascript. This no doubt isn't the same as your php validation script, so it's not especially weird it does something different.

  5. #35
    New Coder
    Join Date
    May 2011
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dear SB65,
    I agree the danger with IE so when you say validate my code what is the procedure you mean post to the w3c site ? For the Doctype I have added this right at the top as below. Do you that is fine or shall I add it some where below?

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <?php 
    session_start();
    So the problem in the showTab when called from javascript is that this part is not working. Any idea how to make it work from javascript calling itself?

    Code:
    <?php 		 
        $driverDetails='';
        $driverLicenses=true;
        $driverEmployment='';
    ?>

  6. #36
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Doctype should be right at the top, yes. And yes, use the w3c site to validate. The biggest issue for IE is the lack of a doctype.

    Re validation, the problem is that the conditions within your validateForm javascript function which cause showTabs to fire are not met - that's where you need to look.

  7. #37
    New Coder
    Join Date
    May 2011
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dear SB65,
    Actually by including the doctype what it does to your web page? What effect it will bring?

    RE validation. For instance below all the show and hide of the elements works well because it shows the right content. Thus only the php part below is not working.

    Code:
    else if(tabID=="driverLicenses")
    	{
    		//alert("DD : "+tabID);
    		document.getElementById("driverDetails").className = "hide"; 
    		document.getElementById("driverLicenses").className = "show";
    		document.getElementById("driverEmployment").className = "hide";
    		<?php 		 
        $driverDetails='';
        $driverLicenses=true;
    		$driverEmployment='';
    		
    		?>
    	}

  8. #38
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    Have a look here for info about doctypes.
    You need a valid doctype to make IE behave.

    ...Thus only the php part below is not working.
    What? No, it is the javascript validateForm function that's the problem.

  9. #39
    New Coder
    Join Date
    May 2011
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dear SB65,
    If the validateForm have the problem it can not call the showTab function. But in my case I am very sure it is calling the showTab function because I have tested it with the alerts.

  10. #40
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    OK, I've no intention of arguing with you.

  11. #41
    New Coder
    Join Date
    May 2011
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dear SB65,
    Come on we are not to learn not argue hehe how can I argue with you when you have helped me so much ok no way. I am just confirming sorry incase you felt me arguing ya. No argue all is to learn.

  12. #42
    Senior Coder
    Join Date
    Feb 2009
    Location
    Ilkley, West Yorkshire, UK
    Posts
    2,957
    Thanks
    9
    Thanked 727 Times in 721 Posts
    I've misunderstood your problem. What you're saying is that the tab is changing correctly, but that the tab heading is not changed to match.

    However it is changed when clicked - so here the javascript is fine, but when called from the validate it isn't.

    Can't immediately see why that is...

    In fact, the showTab function does nothing to the tab heading, so to an extent that's expected. Is there something else driven by the click event on the tab I wonder.
    Last edited by SB65; 05-02-2011 at 08:16 PM.

  13. #43
    New Coder
    Join Date
    May 2011
    Posts
    85
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dear SB65,
    At last you saw my problem. This is what eating my thoughts what else could be wrong. Why when I press the tab is ok but not from the java script function? I am also figuring it out incase you can see please let me know.


 
Page 3 of 3 FirstFirst 123

Posting Permissions

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