xml/xls toggle data with radio button

Soldato
Joined
18 Oct 2002
Posts
9,223
xml/xls toggle data with radio button (new question added)

Hi,

Im looking for some help. I have 2 sets of data, one called "train" one called "plane". I also have corresponding radio buttons relating to each of these 2 options. I am trying to figure out how I can toggle between each set of data when the relavent radio button is selected. For example, when the train radio button is selected the train data will be shown whereas the plane data will be hidden.

Can't find anything through google which may help me achieve this, I really don't know where to start :confused:

Thanks,

Adam
 
Last edited:
Thanks for your help, although I should have specified that I cannot use any server side code. I might give up on this for now and try it solely with javascript as its turning into a nightmare.
 
Ok, I am still having problems.

I need a page which I can select between two different types of data (as per my train and plane example above). I have managed to get this working in javascript. I also need to be able to sort the order of the data that then appears (sort fields such as price or the ID of the plane/train) which I have followed another example which explains how to do it using XSLT.

Is it possible to combine the both? Im struggling to see how, my javascript example works, but its as if the data is appearing on a new page. I can't then add any extra buttons or form elements to be able to sort the data as per how I want to sort this. Similarly, I can't find a way using XSLT to filter the different plane/train data in my XML file but I have the code working to sort the data.

So, to summarise. Im allowing the user to make a choice to display data relating to a train or a plane. When this data appears following the users choice, I want to display some form elements such as a button to be able to sort the data by the ID of the train/plane or by price.

Can anyone help please?
 
Unfortunatly I wasn't able to work out a solution from that website, thanks anyway.

Ok heres what I have so far.

Function for the button:

Code:
function returntransport()
	{
	var nodes, selection
	selection = document.transporttype.go.value
	if (selection == 0)
	alert("Transport selection")
	else if (selection == 1)
	nodes = declaration.documentElement.selectNodes('/transport/train')
	else if (selection == 2)
	nodes = declaration.documentElement.selectNodes('/transport/plane')

My buttons:

<form name="transporttype">

<input type="button" name="go" value="train" onclick="returntransport()"/>
<input type="button" name="go" value="plane" onclick="returntransport()"/>

</form>
 
Back
Top Bottom