someone help me!!
i'm taking a computer science class and i'm totally lost on my html/javascript project...
These are the instructions: Create a web page with JavaScript functions that contains an input form for student data. It should accept: student last and first names; student identifier; major; midterm and final scores (out of 100 possible); class score (in percentages); final grade (the latter two calculated from the former two). Use JavaScript to allow for flexible input (no hard-coded data.) Finally, display a list of three students that the user has entered.
mainly, i don't know how to submit all of the data to another file or page...
or how to display a list of 3 people the user has entered...
this is what i've managed to piece together so far:
its an online, uber-condensed course...
and most of the students in our forum are more lost than i am...
we're encouraged to use the internet as a resource and share info...
i've checked a bunch of tutorial sites already...
but its hard to find exactly what you need in those...
thought someone on here might be able to help...
mainly, i don't know how to submit all of the data to another file or page...
OK, to start... A form using the "POST" method can only be submitted to a server-side document (ASP, JSP, PHP, etc.) for processing. If you are going to be submitting to an HTML document, then you need to use the "GET" method of submission.
If, at the end, you have to display a list of several entries, you want be able to do it client side, so you need a server solution where you store the data.
If you are using PHP the global variables $_POST and $_GET contain the data you submitted via a form or the get variables.
if you have the input field <input type="text" name="test" value="" /> then you will be able to read the data with: $_POST['test'].
Then you have to store them in a file, or a database.
Don't blame ya, when you get a second person throwing separate issues at you than the one you asked about. I'll just step outtta here at let the interloper take over.
Don't blame ya, when you get a second person throwing separate issues at you than the one you asked about. I'll just step outtta here at let the interloper take over.
lol, sorry, I didn't mean to offend anyone!
I just ment: If you have several users, entering several sets of data, you have to store this somewhere, if you want to be able to process the data afterwards.
If this is not the case, you don't have to store the data anywhere, and you can process it with javascript.
top.location.search is used to read the get variables.
Seriously, no offense taken. I just know it is not easy to listen to two people giving advice at the same time about two different things at once. So... You apparently wanted to take over here and I have no problem giving it to you. There are plenty of other places to help.
I just ment: If you have several users, entering several sets of data, you have to store this somewhere, if you want to be able to process the data afterwards.
ok...so should i open a domain at freeservers.com or something?
if so, how would i go about scripting to get the data to the server?
do i need to create some type of database or form?
is this the ONLY way to list 3 users info?
You said you were taking a class. Don't you think you should stick to what your current level of learning is? I think the class intended you to store the data in an array in the first page and then submit the content of that array to the second page for formatting and display. That is generally what JavaScript classes do.
This is the sorta frustrating thing about when someone else jumps into the middle of a thread -- they may not have the same picture of things from the begining and, therefore, try to take the OP off in directions they probably shouldn't be going.
But, I could be wrong. Hey, who ever said 26+ years of experience ever taught anyone anything.
you're right...
a server-side solution seems a little advanced for where we are in the class...
i think the array idea sounds a bit more appropriate...
so how would I store 3 users data in an array on the 1st page?
You'd need a 2-dimensional aray for that. A table is an example of a 2-dimensional array (rows and columns are the dimensions). The following is an example of a JavaScript 2-dimensional array:
var jsTable = new Array();
jsTable.push( new Array("a", 1, 4) );
jsTable.push( new Array("b", 2, 5) );
jsTable.push( new Array("c", 3, 6) );
This also demonstrates the technique you can use for updating this array with each entry made in your form. The form, of course, will accept only a single user's information at a time.
Bookmarks