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.
[07:49 am]
NimoStar -- https://staredit.net/topic/18925/ I am gathering pydat and other python suite fields labelled wrongly
[06:28 am]
Oh_Man -- AI just beat portal autonomously u heard it here first
[02:33 am]
Symmetry -- LLMS aren't intelligent and neither are most people :hurr:
[01:24 am]
Moose -- It's okay, I don't have "real" intelligence either because I'm retarded
[11:30 pm]
Zoan -- ya totes
[10:52 pm]
NudeRaider -- one thing I find fascinating is how sure many people are AI is not "real" intelligence. "It's just a probability machine". Well yes, but who told you your brain isn't?
[09:05 pm]
Zoan -- beep beep
[09:05 pm]
Zoan -- btw speaking of movies we saw Coyote vs Acme last night; that movie was great imo
[09:04 pm]
Zoan -- I threw in more of my thoughts, get ur popcorn ready
Please log in to shout.


Members Online: lifebot, Oh_Man, IskatuMesk