This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
Need Code for Buttons Please

First, slackerbabe, if I understood you to mean that the 'horizontal rule' should not have been in the middle of my code, then yes, that must have been what I did. Thanks.

At the moment I'm having a slight problem with two buttons I added to two pages (only one button per page) to connect them back and forth with each other.

The page I'm working on is: http://pub32.bravenet.com/chat/show.php/2695093273

I want to connect it to: http://fibrofog.bravehost.com/java.html

The code I'm trying to implement was found on this page:
http://resources.bravenet.com/scripts_archive/javascript_dhtml/buttons/forwardback_buttons/

Can you tell me or someone else that might know tell me where I went wrong? I know this much -- I believe the problem lies in the fact that I don't know how to tell it where I want it to go. Possibly, the 'history.go' portion (from the original code) needs to be altered differently than I did?

All I want to do is use what (again, in the original code) was considered the 'back' button to return people back by clicking my 'Live Chat' button. In turn, I wanted to use the 'forward' button to send people to the other page if they even needed to go there. Only people unsure of their browser capabilities need go there, but if they do, I had no way of returning them to where they had just been short of using their own 'backspace' button from their browser. I was trying to avoid that and make it easier for my visitors. Thanks, you guys!

Bern

Browser: SBernheart,2

Re: Need Code for Buttons Please

.... short of using their own 'backspace' button from their browser. I was trying to avoid that and make it easier for my visitors.

Bern, there are experienced visitors and inexperienced visitors. I believe that experienced visitors will prefer to do things the way they are used to (back button). As for inexperienced visitors, the main difference is that they will be mortally confused if you introduce alternatives to standard browser functions. Especially alternatives that depend on something being enabled.

In other words, as I always say when I don't know how to do something: "This isn't worth doing." Let them use the back button.

Anything that makes your page more complicated, and isn't there to answer some real need, is bad.

Re: Need Code for Buttons Please

Corwings: Did you look at the pages in question? I may have mislead you as well, because if you didn't actually view them you probably didn't understand my need of the buttons -- at least one of them anyway.

See, on the Click Here redirect, the 'browser capabilities' I spoke of wasn't about their knowing how to use their backspace function, but rather whether or not their browser is capable of accepting the Java Applet necessary to use the Live Chat. Soooo, I'm giving visitors the choice to go to another page that lists different browsers, OS and authentications and whatnot.

OK, having said that, once a visitor clicks Live Chat from that page, I want them to return to the first page easier -- not because they may not understand their 'browser's capability to use the backspace button', but just to send them back, period. The Java page is rather cold and impersonal and has nothing on it to send it to or from ANYwhere, not to mention MY page.

Does this explain it a little better? I always seem to have a hard time getting my point across that I sometimes put TOO MUCH info that it tends to get more confusing than it needs to be. Case and point -- I bet I REALLY confused everybody now! Does it really matter WHY the buttons are important to me anyhow? Talk about confusion -- I think now I'M confused!!!

I got the idea to use buttons rather than simply using URL's to redirect because I thought it not only seemed easier as I stated, I thought it LOOKED better, too. Anybody else agree? Normally I hate to use the 'Disabilty' card. but my site is about an illness that affects the muscles with chronic pain, so anything I can do to make things easier isn't meant to presume my visitors' capabilities -- that would be rude -- I know first hand what it's like on a 'bad day' and to have a button that says exactly what you need it to say is a comfort. But I digress.

I apologize for going off on a tangent. I guess I needed to vent!! Sorry, Corwings, nothing personal. I was just taken back by your reply. Next time, if it's not worth it to explain something you feel may be redundant, pass it by. All of this could have been spent correcting my code. Instead, you wasted more of MY time, not yours. 'Till next time....

Bern

Browser: SBernheart,2

Re: Need Code for Buttons Please

OK, I misunderstood what you are doing and why.
No, though I usually do, I didn't visit your page.
Mostly because I don't do javascripts, so "explaining something I feel may be redundant" wasn't an option anyway.

So I "wasted more of YOUR time, not mine". Well, too bad, but I count 9 lines. If you post a question on a public forum and don't get to read more than 9 lines of bad advice, you've been lucky.

And clearing up a misunderstanding about what you are trying to do seems worthwhile in case there are other illiterate morons out there. (And if you think illiterate morons never know anything about javascript, you haven't been to as many webpages as I have)

Re: But I Still Need Code for Buttons Please

Awww Corwings, you shouldn't have....
....but I'm glad you did. I don't think you're an illiterate moran either. I almost posted a question about all the questions about  'Myspace'. The most obvious answer for ALL the questions was to post on Myspace, not Bravenet! I couldn't get an answer to my first post. I eventually stumbled on the answer myself, but that's not the point. Hey, who am I to say who posts what or where they post, so thankfully, I let it go.

You're right about the fact that at least the next guy may not make the same mistake, but as I stated, I must not have explained that, and I'll say it now, I need help with a pair of buttons -- not Java. True, the buttons I need the code for are going to connect pages concerning  Java, but have absolutely nothing, in of themselves, to do with scripts and such.

Now that it's understood what my intentions are, you don't know how to fix the code either? I know you don't know anything about scripts, but what about buttons? Does anyone else know anything about buttons? The original code looks like this:


body
center
form
input type="button" value="back" ="history.go(-1)"
input type="button" value="forward" ="history.go(1)"
/form
/center

Of course the '> & <' symbols I removed or else you would have seen the results of the code rather than the code itself. I removed the 'body' because my page already has it. Then I preceeded to 'split' the code to look like this:

center
form
input type="button" value="back" ="history.go(-1)"
/form
/center

Then this:

center
form
input type="button" value="forward" ="history.go(1)"
/form
/center

Lastly, I also changed the 'back' and 'forward' entries to 'Live Chat' and 'Click Here', respectively. So how do I get the buttons to go to the other page and back? I believe it's simply a matter of replacing something with the URL of each page, but my attempts to 'change this and that' proved futile.

It seems simple, but yet I can't figure it out!

Bern

Browser: SBernheart,2

Re: Need Code for Buttons Please

Bern,

I will try to explain this to you as best I can. I understand it just fine, but it's sometimes difficult to explain properly. The code that you are trying to work with is listed below:










When you use a tag of type "button", the action parameter, "onClick", is expected to be a JavaScript reference. This can be a single command, like the "history.go()" command, or it can be a complete JavaScript program, containing multiple commands. But it has to be JavaScript. While this type of tag is very versatile, you can't just do a mix and match game.

When you try to replace the Javascript reference, "history.go()", with a "http://...." reference, you are mixing HTML and JavaScript. This can be done, but only if you use a Javascript wrapper. On your Java page you have the following:



The "http://...." reference is not a JavaScript command and therefore not understood directly by Javascript. The "(-1)", taken from the original "history.go()" command, is a method of passing a parameter to the "history.go()" command. Since the "http://...." reference is not a Javascript command, the "(-1)" is meaningless.

As I previously mentioned, to put it together so that it works properly, you need to create a JavaScript wrapper.



I would put the button here, for you to try, but the forum will erase the Javascript reference and render it useless. You should be able to just do a copy paste of the code into your web page, to test it. I tested it and know it works.

Note, in the code above, there is a set of single quotes around the "http://...." reference, which is within double quotes, that delimit the entire JavaScript command. These are necessary to sort of group the code, so that it is understood by JavaScript properly.

JavaScript is not difficult to understand, but it is very different than HTML. If you want to do more with javaScript, you need to get a good book, or a good tutorial, and start learning. Personally, I would have done your page completely different. I would have wrapped the whole page in a JavaScript routine that popped up a window. The window could be viewed, and thrown away, without the visitors browser ever leaving the chat page. Then there would be no need for a back button at all.

Re: Need Code for Buttons Please

Thanks for the help, Martin. I apologize for my late reply. I must also apologize to you, too, Corwings. You were half right or I was half wrong or both! According to Martin, the buttons in question does involve JavaScript. I don't know how I thought it was as simple as replacing one address with another, but nothing's ever that easy so I should have known better. Guess that makes me the 'illiterate moran' (script illiterate, that is).

"I will try to explain this to you as best I can. I understand it just fine, but it's sometimes difficult to explain properly."

You did a great job, Martin. You did so without condescension and I appreciate that. I'm a self-taught coder, for a lack of a better term, learning something new every day. Now I understand a little JavaScript and I better learn somemore if I want to keep up with the ever growing technology.

"I would have wrapped the whole page in a JavaScript routine that popped up a window. The window could be viewed, and thrown away, without the visitors browser ever leaving the chat page."

Baby steps, Martin, baby steps! It does sound like a good idea, though. I love things that I call 'add-ons' (not to be confused with what everybody else considers add-ons). My website may be primitive to most, but where else would one start but at the beginning? As I come along, so will my website. I want 'mouse-overs' for definitions, pop-ups (not the bad ones though) for visitor help and some video for live feeds just to name a few. I'd also like to contribute information to Wikipedia or WikiNews, if I ever get around to it.

My eyes may just be bigger than my stomach for all of this, but I usually do bite off more than I can chew so it's nothing new! You'll see me here a lot so pay attention and help me get there, OK? Thanks guys!

Bern

PS: I like your website, Martin. If you don't mind, I'll be checking out some of the JavaScripts you've got going on. On first glance, I like the 'E-Mail Web Page' you've set up for yourself. I know (and use) Bravenet's e-mail forms, but I like yours. To me, all I've done to date is merely a stepping stone for greater things to come. I plan on having fun along the way, otherwise, what's the point?

Browser: SBernheart,2

Re: Need Code for Buttons Please

Bern posted: "I always seem to have a hard time getting my point across that I sometimes put TOO MUCH info that it tends to get more confusing than it needs to be."...

haha Bern, I TOO suffer from that!!..really...In having a hard time verbally expressing my thoughts, I overcompensate, which in turn leads to mass confusion..

of course I'm not saying you're as bad off as me, but...

I'm glad the knowledgeable ones answered you, because, aside from not being here that much, I have no idea what you're talking about lol (i do admit i gave up reading midway though, once I saw you had gotten help)

I learned a lesson too... 'don't add anything extra when posting code'..sorry about that lol

Re: Need Code for Buttons Please

if you want a chat room and a search box on your site you can get the code from

http://unitedontheweb.com/scripts.html

it might help you to get some visitors

Thanks for the Help

Hey, Slack (may I call you 'Slack'?)! No problem. I don't understand half the stuff I write, so how can I expect you to? LOL LOL LOL Thanks for stopping by!

Peter, I checked out the site you recommended and I'm playing around like, with the colors, matching it with my pages. Looks good -- glad you shared.

Oh, I almost forgot! I checked out your site, too, Slack!! It's crazy -- in a good way, that is. I'm working on a page for my sponsors. Anyone that helped me along the way or who's site I happened to like will be displayed there. I'm pretty sure I can use a few of your buttons and such so, I'll be checking it out again. I'd be glad to add your page to the mix. If you have a special icon or whatever, let me know, OK? Otherwise, I'll hook you up as usual. I'm sure my visitors will enjoy your site as much as I did.

Thanks again, Martin. According to Slackerbabe, you are a 'knowledgeable one' so keep up the good work. Kudos & Plaudits to all.....

Bern

Browser: SBernheart,2

Re: Need Code for Buttons Please

You're welcome....slack is fine, slacker, or Kendra :)

I might put my site on your list when I'm finished...now that I'm learning more about this stuff, and understanding it better, I have quite a bit of changes I want to implement...

Its just having the time to redo it..I keep changing my MySpace profile, which takes up what little time I have had lately online...sooo....I have lots of unfinished pages though...hopefully soon i'll get it together
..and thank you

Re: Need Code for Buttons Please

Hello,

Please have a look at my site. Will this code work for the left side of my page. I was wondering how to make my list into buttons.

Re: Need Code for Buttons Please

You need to edit the buttons in a graphics program before uploading. The below was done in PantShop Pro:
Image hosting by Photobucket

Re: Need Code for Buttons Please