Ok, so here is the part concerning the problem I proposed.
======================================
[...]I will try at least to explain roughly what I want to do.
The example is the pillars at the GOE. There you type a string by clicking on the pillars. When this reaches a certain size, it is processed.
In my case it would be enough to have two buttons, but the string must have an arbitrary length, so there must be a third button to append an end character and send the input to the MDscript.
Let's say that two letters "a" & "b" are associated to the first two buttons and a "0" to the third,so that the output of the function has to be a string like "a0", "bab0", "bbbb0".....
This has to be passed to a MDscript variable then, because something will have to be stored at the end, to go on with the quest.
[...]
=======================================
Duxie provided a solution using a hidden button and javascript instructions, all I have done is taking his code and adapting it to MDscript
=======================================
Good, it works exactly as I wanted to...had to do only a few minor tweaks, due to the MDscript restriction
So, this is the html section:
[php]
<html>
<body align="center">
<form name="main" action=" " method="post">
<span id="input_field"></span><BR>
#<?php if (isset(@input['hidden_button'])) { ?><B>submited value=<?= @input['hidden_button'] ?></B><BR><?php } ?>
<input name="button_a" type="button" value="A" onclick="addValue('a')">
<input name="button_b" type="button" value="B" onclick="addValue('b')">
<input name="button_c" type="button" value="C" onclick="addValue('c')">
<input name="button_0" type="submit" value="0" onclick="addValue('0')">
<input id="submit_value" name="hidden_button" type="hidden">
</form>
<script>
function addValue(value) {
document.getElementById("input_field").innerHTML += value;
if (value == "0") document.getElementById("submit_value").value = document.getElementById("input_field").innerHTML;
}
</script>
</body>
</html>
[/php]
and this is the php section for test:
[php]
echo @input['hidden_button'];
echo @content['0'];
[/php]
These are the modifications:
i) the action field is blank. There's no way to give a name to your document, and the only allowed action is that of loading the script again.
ii) the php tag is ignored so it's commented and the command that displays the string is moved to the php section
iii) the name of the hidden field has been changed to "hidden_button". Seems that every string containing "val" detected by the php interpreter gives an error.
iv) access to normal php variables is not allowed so $_POST has been substituted by the proper form handler @input['hidden_button']
[...]