Click to See Complete Forum and Search --> : How do I do this using javascript


DarryBoy
03-02-2003, 12:11 PM
I'm developing a website and would like to use the same method as in this link www.nmi.co.za

How do they populate the bay window when they click on the navigational buttons with the desired text. How is the text correctly positioned in this bay window?

Have you a tutorial I can view to explain step by step on the procedure to do it?

I look forward to your reply.

Regards
DarryBoy

pyro
03-02-2003, 12:14 PM
Well, that site does it with javascript, but it is better to do it server side. If you server supports PHP, check out this: http://www.infinitypages.com/research/divinclude.phpIf you need me to explain more, I will after you let me know if you have PHP.

DarryBoy
03-02-2003, 12:24 PM
I don't have PHP enabled on my server pyro. Have you a solution without using server side.

pyro
03-02-2003, 12:35 PM
Here is the client side solution: http://www.infinitypages.com/research/clientsidedivinclude.htm

But remember, for those without javascript, this will break your navigation...

khaki
03-02-2003, 12:35 PM
DarryBoy wrote:
How do they populate the bay window when they click on the navigational buttons with the desired text.

The answer to that is:
Not very well. It's obviously not designed for cross-browser support.

I think I have some code somewhere that does that though (cross-browser).
I used to use that effect on an FAQ page that I once created.
I'll look for it and get back to you.

if I'm not back wihtin an hour, send for help (my archives are a cluttered and dangerous place. lol)...
k

khaki
03-02-2003, 12:38 PM
woops!
Never mind.
Pyro beat me too it.
(whew... now i don't have to go to that scary place. lol)

scaredy-cat...
k

khaki
03-02-2003, 12:46 PM
Pyro wrote:
But remember, for those without javascript, this will break your navigation...

Since this is the Javascript forum, can't we just assume that we are already excluding those who are not Javascript enabled.

Just by being here and passing information we are excluding that segment of users/visitors.
No need to keep qualifying/aplogizing for it.

my opinion, anyway...
k

pyro
03-02-2003, 01:01 PM
Originally posted by khaki
Since this is the Javascript forum, can't we just assume that we are already excluding those who are not Javascript enabled.Except using javascript for something as important as navigation for your site is unnecessarily excluding 10% of web users...

khaki
03-02-2003, 01:18 PM
Well... I'm not going to spend another Sunday on that topic (been there, done that).

Your right of course.
But you also provided the code.

"Here kid... here's a can of gas and a match.... don't burn yourself though"
(lol)

This is the Javascript forum.... that's all I'm saying. No one should be here unless they have already written-off the "10 percenters" - regardless of the way in which they are applying it.

Not looking for a fight though (it's just a crappy rainy day here in the NY area, so I'm probably a bit grouchy today).
If you feel the need to qualify your responses as such, it's really none of my business.
Sorry for chiming-in.
k (wink)

DarryBoy
03-02-2003, 01:19 PM
Thank you very much Pyro and K for your prompt reples.

Pyro the link for client side http://www.infinitypages.com/research/clientsidedivinclude.htm# doesn't show anything :(

If I had php would it solve the problem of non javascript users? (for future reference)

pyro
03-02-2003, 01:22 PM
What browser are you using? It tested in IE6 and NN7 and it worked fine....

Yes, PHP would solve the issue. :)

DarryBoy
03-02-2003, 01:23 PM
Ignore my previous response Pyro. I see the code. I apologise.

pyro
03-02-2003, 04:58 PM
Ok, glad to hear that it works for you... ;)

regal
03-03-2003, 07:18 AM
Could u tell me y this code doesnot work..I am using this in struts jsp which is y there is the 'issueDetail.amount'.
It throws an error that document.TTIssueOneOffForm.issueDetail.amount.value
is not an ubject or is null.


<script language="javaScript">
alert("test");
function isNumeric(s)
{
alert("inside numeric");
if(isEmpty(s))

return false;

for(i=0;i<s.length;i++)
{
var c=s.charAt(i);
if(digits.indexOf(c) ==-1)
return false;
}

return true;
}

//Check the given String is Empty

function isEmpty(s)
{
alert("inside isempty");
if((s==null) || (s.length==0))
return true;
else
return false;
}
function doSubmit()
{
var amt="Amount should be in numbers";
alert("1");
alert(document.TTIssueOneOffForm.issueDetail.amount.value);
if(!isNumeric(document.TTIssueOneOffForm.amount.value))
{
alert(amt);
return false;

}
else{
alert("form submit");
document.TTIssueOneOffForm.submit();

}
return true;
}
</script>

DarryBoy
03-03-2003, 02:31 PM
Please may I email you Pyro in private so I may show u my graphical image that I'm trying to program using the javascript that I still can't get right.

pyro
03-03-2003, 02:55 PM
Certainly. My email can be found in my profile.