Staredit Network > Forums > Technology & Computers > Topic: Vocabulary-test
Vocabulary-test
This topic is locked. You can no longer write replies here.
Sep 16 2009, 4:21 pm
By: Devourer  

Sep 16 2009, 4:21 pm Devourer Post #1

Hello

Hey everybody,
for my class I recently wanted to code a vocabulary-learn and test site.

My concept was to have a "learn-page" where all vocabluarys are listed, in german and english (we are from germany), that one works with no problem, the "test-page" should be structured like this: on one column there are the german words listed, right next to each in the other column there is a textbox in which the user shall enter the right solution. Another column on the righht there is a "check" button near each textbox, named "check".
You need to know that I'm using a MySQL-Table with 3 columns: ID, Englisch, German, on the learning and on the testing page I'm using "SELECT * FROM vocabluarys....".
The textbox got the name "id" (the current ID of the mysql fetch array).

About the check-button (and the problem):
I wanted the check-button to call via onclick a java-script function with 2 parameters: ids and englishvalue.
Why these two?
ids: I wanted the ids-parameter to receive the current ID of the mysql-fetch-array to use that parameter for getting the value of the textbox.
englishvalue: This one should contain the true english value from the mysql table.

The error: I don't know, after hitting the button nothing happens.

Codes:
The javascript on the header of the .php file:
Quote
function checks(ids, valueenglish){
x=document.getElementByName(ids).value;
if(x!=valueenglish)
{
alert("Wrong");
}
else
{
alert("Right");
}
}

the mysql-fetch-array "while" solution for the textbox and button:
Quote
echo "<td bgcolor='4C4C4C'><input type='text' name='".$row[id]."' style='background: black; color: white;'></td>";
echo "<td bgcolor='4C4C4C'><input type='button' onclick=checks('".$row[id]."', '".$row[englisch]."') value='Check'></td>";

any ideas?
I only know PHP HTML JavaScript and MySQL, don't come along with other languages if possible.

Post has been edited 2 time(s), last time on Sep 17 2009, 5:14 am by DeVouReR.



Please report errors in the Staredit.Network forum.

Sep 17 2009, 12:35 am O)FaRTy1billion[MM] Post #2

👻 👾 👽 💪

"SELETE"? I'm assuming you meant "SELECT". :P

View the page source of the generated page, see if there are any errors in that.



TinyMap2 - Latest in map compression! ( 7/09/14 - New build! )
EUD Action Enabler - Lightweight EUD/EPD support! (ChaosLauncher/MPQDraft support!)
EUDDB - topic - Help out by adding your EUDs! Or Submit reference files in the References tab!
MapSketch - New image->map generator!
EUDTrig - topic - Quickly and easily convert offsets to EUDs! (extended players supported)
SC2 Map Texture Mask Importer/Exporter - Edit texture placement in an image editor!
\:farty\: This page has been viewed [img]http://farty1billion.dyndns.org/Clicky.php?img.gif[/img] times!

Sep 17 2009, 2:01 pm Devourer Post #3

Hello

EDIT: Worked well now. Topic can be closed.

Post has been edited 1 time(s), last time on Sep 17 2009, 3:12 pm by DeVouReR.



Please report errors in the Staredit.Network forum.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[05:59 am]
NudeRaider -- *is
[05:17 am]
NudeRaider -- despite all its flaws the sound design its fantastic
[10:29 pm]
Oh_Man -- homeworld 3 = massive disappointment
[2024-5-14. : 10:05 am]
Moose -- ya
[2024-5-14. : 5:23 am]
zsnakezz -- yes
[2024-5-12. : 8:51 pm]
l)ark_ssj9kevin -- Are you excited for Homeworld 3?
[2024-5-12. : 8:44 pm]
l)ark_ssj9kevin -- Hi Brusilov
[2024-5-12. : 4:35 pm]
O)FaRTy1billion[MM] -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
my server that was hosting it died
[2024-5-10. : 8:46 pm]
NudeRaider -- Brusilov
Brusilov shouted: Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
https://armoha.github.io/eud-book/
[2024-5-10. : 8:36 am]
Brusilov -- Hey, what happened to EUDDB? Is there a mirror for it somewhere? Need to do a little research.
Please log in to shout.


Members Online: Oh_Man, Moose