PDA

View Full Version : Form / Drop down List


Smithereens
08-05-2005, 04:19 AM
Hi folks,

I have a small problem, I'm quite new to html and am trying to design a page where I can change languages. What I want is a drop down menu where I can swap over and back as I choose to the equivalent page in german/english) without having to go back to the start page to choose the language, I had thought of using frames but that just means having to create too many extra html pages.

Any ideas?

Thanks in advance

Gamini
08-05-2005, 04:24 AM
Are you having the problem with making the dropdown? Or do you need a solution to switch languages without creating seperate pages for each language?

Smithereens
08-05-2005, 04:29 AM
Are you having the problem with making the dropdown? Or do you need a solution to switch languages without creating seperate pages for each language?
Thre drop dow is no problem, it's the switching I can't get to work (I can get it to change to one language but not back to the other)

Here's what I have (the problem is with the "form action" or is it even possible to do it like I'm trying using just html?):

<form action="German_me.html" name="form" method="post">
<input type="hidden" name="mailUrl" value="">
<table >
<tr>
<td>

<label for="Language"><span class="labeltxt">Language</span> </label>
<select id="Language" name="countryselect" title="Language" tabindex="10">

<option value="German_me.htm">Deutsch</option>
<option value="english_me.html.">Englisch</option>


</select>
</td>
<td><label for="Language"> <input type="submit" alt="Choose" class="button" value="Go!" tabindex="21" ></label></td>

</tr>
</table>
</form>


Thanks!

_Aerospace_Eng_
08-05-2005, 04:31 AM
No you can't do this using HTML alone. You will either need javascript or some server side language like PHP or ASP. Just let us know what you want to use and I'll move this to the appropiate forum.

Smithereens
08-05-2005, 04:37 AM
No you can't do this using HTML alone. You will either need javascript or some server side language like PHP or ASP.

I thought as much, I'd rather java script (I want to start learning that anyway so this'll be a start :) )

Thanks a lot for the help so far.

_Aerospace_Eng_
08-05-2005, 01:42 PM
Okay here you go, it goes to the selected page on change.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script type="text/javascript">
function changeLang(what){
if(what.options[what.options.selectedIndex].value=='none'){
return false;
}
else {
window.location=what.options[what.options.selectedIndex].value;
}
}
</script>
</head>

<body>
<select name="lang" onchange="changeLang(this)">
<option value="none" selected="selected">Choose your language</option>
<option value="english.html">English</option>
<option value="french.html">French</option>
<option value="spanish.html">Spanish</option>
</select>
</body>
</html>
See if thats what you want. In the mean time I'll move this to the client side forum.