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.
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.
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?
I'd suggest validating your code and adding a valid doctype. IE may be displaying what you want but it isn't displaying correctly.
Quote:
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.
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?
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.
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.
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.
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.
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.
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.