0

i created a dropdown list containing university names e.g. 'oxford' 'cambridge' and so on. I would like the uni selected from the dropdown list to be sent to another page as the heading.
I am having trouble doing this myself and I dont want to create a page for every single uni. can anyone help?

3
Contributors
10
Replies
11
Views
7 Years
Discussion Span
Last Post by javaAddict
0

First of all this is a question for the JSP forum.
Secondly what do you mean when you say "heading". Explain better with some code.
Also you can submit the page and when you go at the the next page you can do this:

<%
String uni = request.getParameter("uni");
%>
<head>
<title><%= uni%><title>
</head>
0

by heading, i mean a new layer on the 2nd page, i would like the selected text sent from the drop down list on page1.htm to a new layer on page2.htm

0

Please forgive but I don't understand what you mean by new layer. Can you post code or a picture indicating where you want the "uni" to be displayed?

0

there is another quick help i need aswell me getting the code for what i just said. here is a code i hae for moving an item from one list box to another, but the item will not move... the you know what is wrong ith what i wrote.

<table border="0">
	<tr>
		<td>
			<select name="sel1" size="10" multiple="multiple">
			<option value="1">Left1</option>
			<option value="2">Left2</option>
			<option value="3">Left3</option>
			<option value="4">Left4</option>
			<option value="5">Left5</option>
			</select>
		</td>
		<td align="center" valign="middle">
			<input type="button" value="--&gt;"
			 onclick="moveOptions(this.form.sel1, this.form.sel2);" /><br />
			<input type="button" value="&lt;--"
			 onclick="moveOptions(this.form.sel2, this.form.sel1);" />
		</td>
		<td>
			<select name="sel2" size="10" multiple="multiple">
			<option value="1">Right1</option>
			<option value="2">Right2</option>
			<option value="3">Right3</option>
			<option value="4">Right4</option>
			<option value="5">Right5</option>
			</select>
		</td>
	</tr>
</table>
</form>

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.

0

If it doesn't work then there is a problem with the "moveOptions" method for which you didn't provide code

0

i am a beginner in writing sripts so i would need help in how i would and where i would write this 'move' please

0

I never had to do something like this before, so frankly I am not in the mood to write code that does that.
But If I were to do this I would look at this site:
http://www.w3schools.com/default.asp
for tutorials on the subjects:
HTML DOM and
DHTML

You can use the id attribute to get the "select" and "option" tags as javascript variables and by using the above tutorials and API you can manipulate them

0

here is the code i am using,

<html>
<head>
<script type="text/javascript">
function University()
{
var mylist=document.getElementById("myList");
document.getElementById("favorite").value=mylist.options[mylist.selectedIndex].text;
}
</script>
</head>

<body>
<form>
Select your University:
<select id="myList" onchange="University()">
  <option>Brunel</option>
  <option>Kingston</option>
  <option>Kent</option>
</select>
<div id="Layer1" style="position:absolute; left:368px; top:175px; width:257px; height:100px; z-index:1">Your University: <input type="text" id="favorite" size="20"></div>
</form>
</body>

i want the 'select your uni' to be on page1.htm and the second part 'your university' = the result to be on page2.htm, how o i go about this please.

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.

0
<select name="selectedUniversity" >
  <option>Brunel</option>
  <option>Kingston</option>
  <option>Kent</option>
</select>

Submit the form to the next page and at the next page have this code:

<%
String university = request.getParameter("selectedUniversity");
if (university==null) university = "";
%>


<div id="Layer1" style="position:absolute; left:368px; top:175px; width:257px; height:100px; z-index:1">
Your University: 
<input type="text" name="favorite" value="<%= university%>" size="20">
</div>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.