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.
[04:15 am]
DarkenedFantasies -- you eat lots of beans
[03:46 am]
IskatuMesk -- how do i get gas
[11:43 pm]
Moose -- you don't
[10:06 pm]
Zoan -- how do i get minerals
[2026-4-14. : 11:45 pm]
ClansAreForGays -- Anyone wanna played Skewed StarCraft?
[2026-4-14. : 12:07 am]
Vrael -- NudeRaider
NudeRaider shouted: Vrael ranting still is though
you're a gentleman and a scholar, thank you
[2026-4-13. : 10:07 pm]
NudeRaider -- ya why phone people when you can just write letters
[2026-4-13. : 9:37 pm]
IskatuMesk -- I have never and will never own a phone
[2026-4-13. : 9:15 pm]
NudeRaider -- Vrael ranting still is though
[2026-4-13. : 9:14 pm]
ClansAreForGays -- anticapitalism isnt edgy anymore
Please log in to shout.


Members Online: Vrael, O)FaRTy1billion[MM]