/    Sign up×
Community /Pin to ProfileBookmark

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. ?
Thanks for every help!!?

to post a comment
Full-stack Developer

7 Comments(s)

Copy linkTweet thisAlerts:
@lisauthorMar 21.2007 — 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!
Copy linkTweet thisAlerts:
@TheBearMayMar 21.2007 — 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.
Copy linkTweet thisAlerts:
@FangMar 21.2007 — What is LEO?

An online dictionary requires knowledge of a server-side language(PHP, ASP etc) and SQL, not a project for the beginner.
Copy linkTweet thisAlerts:
@TheBearMayMar 21.2007 — Threads merged.....
Copy linkTweet thisAlerts:
@TheBearMayMar 21.2007 — Over time and as more words get added this won't be viable, but a simple lookup with javascript would look something like:
[code=html]
<?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" />
&nbsp;English to German&nbsp;<input type="checkbox" id="e2G" checked="checked" />
<br />
<button onclick="findWord(document.getElementById('tSrch').value)">Search</button>

</body>
</html>
[/code]
Copy linkTweet thisAlerts:
@mcgheecMar 23.2007 — I like this.

Just used it for a bit of fun
Copy linkTweet thisAlerts:
@lisauthorMar 27.2007 — I just needed to know if i could do it.... so thank you anyway?
×

Success!

Help @lis spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...