SitePoint Sponsor

User Tag List

Results 1 to 9 of 9

Thread: buttons

  1. #1
    SitePoint Addict
    Join Date
    Feb 2000
    Location
    New York
    Posts
    307
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I want to use a standard boring grey button for navigational purposes. I dunno, maybe its pretty elementary, but I don't know how to do it and my Liz Castro HTML QuickStart book (the "old standby") doesn't seem to cover it.

    Although I will incorporate it into a perl cgi script, let me just pretend here that it is a simple html document.

    I want to do something like this:
    <input type="button" value="Home" onClick="http://www.domain.com">

    I want the user to see the grey button with "Home" on it and clicking it will take them there

    Could some one kindly let me know how to accomplish this?

    [4/11/00 - I shouldn't have said "Home" - I want the user to go to the "Main" page.]

    [This message has been edited by Ted (edited April 11, 2000).]

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Change your onClick command to "window.location('http://www.somepage.html')" and your on the right trick.

    ------------------
    Wayne Luke
    WR Moderator
    Internet Media Provider

  3. #3
    SitePoint Addict
    Join Date
    Feb 2000
    Location
    New York
    Posts
    307
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Thanks Wayne. But... I couldn't get it to work. The button appears on the page, put when I click on it, nothing happens and I get an "error on page" in the status bar. (IE5) Any suggestions?

    ------------------
    Ted

    DSM Trader


  4. #4
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Send me the URL and I will take a look at it.

    ------------------
    Wayne Luke
    WR Moderator
    Internet Media Provider

  5. #5
    SitePoint Member
    Join Date
    Sep 1999
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The answer to your question (if I understood it correctly): http://dynamicdrive.com/dynamicindex5/ns4home.htm

  6. #6
    SitePoint Addict
    Join Date
    Feb 2000
    Location
    New York
    Posts
    307
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Nice to offer Wayne... but I have no url yet. I have been playing with the code locally and havent put it on the server.

    If you have a second, and want to see where is will be utilized, go to the DSM Trader. Then click on "View Ads!". You will get a cgi script output of classified ads, and on the bottom, you will see buttons for Back and Next. I want to ad a Main Page button, because, if a user is several pages deep in the cgi output, there is no way for them to easily get back to the main page. (So I am going to put the required html into the script.)

    adashimar, that button at DD has got the appearance I am looking for... but that script sends the user back to their browser's homepage which is not what I am looking for. Thanks though.



  7. #7
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    if you know how the user got to the page and how far it is to the main page, you can use the history.go() method:
    onClick="go(-x)";
    where "-x" is the number of pages.
    Or, you can try the following:
    var gohome = "location.href = 'homepagename.html'";
    onClick="eval(gohome)"

    Vinny



    ------------------
    GrassBlade: cut&paste javascript

  8. #8
    SitePoint Addict
    Join Date
    Feb 2000
    Location
    New York
    Posts
    307
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I wouldn't know how far (how many pages from) the "main" page they are... so I couldn't use the history method, and why would I want to send a visitor away to their homepage ?

  9. #9
    SitePoint Addict
    Join Date
    Feb 2000
    Location
    New York
    Posts
    307
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Oh, the heck with it, I'll just put a different type of link there and try to find the solution to the getting that button there at the next redesign.

    Thanks for trying to help!

    [This message has been edited by Ted (edited April 12, 2000).]


Bookmarks

Posting Permissions

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