Getting OnClick Buttons to Work with XML

Discussion in 'ASP Snips' started by sommardahl, Nov 1, 2005.

  1. sommardahl

    sommardahl Guppy

    I am working on a project for school and have hit a brick wall. The HTML code below calls up the first recordset in the XML document JUST FINE. It displays the picture and text without problem. Here's the problem. The buttons at the bottom don't do anything. No page refresh, no data update. I can't figure it out. If you can offer some help, please post it here:

    Code:
    <html>
    <head>
    <title>XML Data Test</title>
    </head>
    
    <body>
    <xml id="try" src="default.xml"></xml>
    <img datasrc="#try" datafld="Cover"> </img>
    Artist: <div datasrc="#try" datafld="Artist"></div>
    Album: <div datasrc="#try" datafld="cd"></div>
    Year: <div datasrc="#try" datafld="Year"></div>
    Song: <div datasrc="#try" datafld="Song"></div>
    
    <BUTTON ONCLICK="try.recordset.moveFirst()">&lt;&lt;</BUTTON>
    <BUTTON ONCLICK="try.recordset.movePrevious()">&lt;</BUTTON>
    <BUTTON ONCLICK="try.recordset.moveNext()">&gt;</BUTTON>
    <BUTTON ONCLICK="try.recordset.moveLast()">&gt;&gt;</BUTTON>
    
    </body>
    </html>
    Sorry if this is the wrong place to post this. -Byron
  2. Stephen

    Stephen US Operations Staff Member

    Oh I did not read this in assocation with the PM, I guess you are not usng an ASP Code, I don't know XML well enough to help you :(
  3. sommardahl

    sommardahl Guppy

    Nope. The teacher doesn't want us to use any ASP or Javascript. It kinda sucks since I know ASP so well. This is my first stab at XML. It's so frustrating when everything looks like it should work and it just doesn't.

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services