Javascript & HTML for passing values between pages?

Javascript & HTML for passing values between pages?

by Thanasis Pappas -
Number of replies: 2
Hello I would like to make an application in moodle, so that when a user gives some information (i.e. age, name etc) the system can proccess them and type them back in the next page. I tried to "create a web pages" by moodle default wizard, and I used some javascript and html codes, but I don't know how to link one page to another so that the values will be passed from the first page to the second one. Is there any other way to do that in moodle and NOT in an external server? Thank you
Average of ratings: -
In reply to Thanasis Pappas

Re: Javascript & HTML for passing values between pages?

by Itamar Tzadok -
an application in moodle, so that when a user gives some information (i.e. age, name etc) the system can proccess them and type them back in the next page

That's a rather vague description. You can use the database activity module to create an form which users can use for entering information. This module also allows you to incorporate javascript so you can do quite a bit of information processing. This information can then be displayed in various formats in the activity and/or populated to other pages. smile
In reply to Itamar Tzadok

Re: Javascript & HTML for passing values between pages?

by Thanasis Pappas -
Thank you, I will try this out! I am trying to make something like an algorithm that classifies students according to some characteristics of them. So I had it in php, but moodle doesn't seem to accept php files under the "create web page" option. Therefore, I tried to design it using javascripts, but when I navigated from the one page to the next (from the forms to the results), a message "values are not valid!!" appeared. I guess it is because moodle uses this form of page addressing: ...php?id=6 and maybe javascript cannot work with this. Because when I tried this to independent html files, it worked fine.

I will try the database option, let's see..!