Click to See Complete Forum and Search --> : need help, try to create an online dictonary
I try to create an online dictonary for a schoolprojekt.
But I need to know if there's a HTML code to write
a search field (like the one on LEO e.g.) to look up the words. :confused:
Thanks for every help!!:)
I really need your help! I would like to create an online dictonary for a very important school project but I don't know how to make a search field. You should be able to type in your word and then automaticly come to a new site with the translation.(want to make a English/German dictonary).
Is there a simple HTML code? If not is there any HTML code? Thanks for any answer!
TheBearMay
03-21-2007, 06:46 AM
Couple of ways you could go about this depending on what you have available. Best way requires the use of some server side processing (PHP, JAVA, ASP, ASP.net, CGI, etc), but I'm guessing that you might not have that available. If my guess is correct there are still ways of doing it but you'll need some javascript.
What is LEO?
An online dictionary requires knowledge of a server-side language(PHP, ASP etc) and SQL, not a project for the beginner.
TheBearMay
03-21-2007, 10:33 AM
Threads merged.....
TheBearMay
03-21-2007, 10:48 AM
Over time and as more words get added this won't be viable, but a simple lookup with javascript would look something like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Word Lookup</title>
<script type="text/javascript">
var gArr=["GermanWord1", "GermanWord2"];//add German words to this array
var eArr=["EnglishWord1", "EnglishWord2"];//add English words to this array
var wordArr = new Array(gArr, eArr);
function findWord(sWord) {
if (document.getElementById("e2G").checked) {
for (i=0;i<eArr.length;i++) {
if (wordArr[1][i] == sWord) {
alert(wordArr[0][i]);
break;
}
}
if (i>=eArr.length) alert(sWord+" not found");
} else {
for (i=0;i<eArr.length;i++) {
if (wordArr[0][i] == sWord) {
alert(wordArr[1][i]);
break;
}
}
if (i>=eArr.length) alert(sWord+" not found");
}
}
</script>
<body>
<input type="text" id="tSrch" />
English to German <input type="checkbox" id="e2G" checked="checked" />
<br />
<button onclick="findWord(document.getElementById('tSrch').value)">Search</button>
</body>
</html>
mcgheec
03-23-2007, 05:24 AM
I like this.
Just used it for a bit of fun
I just needed to know if i could do it.... so thank you anyway;)