I'm looking for way to load value from textbox into variable.
I've tried:
<p>
<textarea id="Text" name="Text" rows="6" cols="36"></textarea>
</p>
<p>
<input type="button" name="Button" value="Do it" onclick="javascript:job()" />
</p>
function job() {
var data = {};
data = document.getElementById("Text").value;
// other part of code
}
This way doesnt work. If I put my data in {} script works perfectly
Working example:
var data = {
"Something1": "Otherthing1",
"Something2": "Otherthing2",
"Something3": "Otherthing3",
};
But the data is each time different, thats why I need to load it from user input
Edit: Well, working script from console returns data as
Object {Something1: "Otherthing1", Something2: "Otherthing2"}
Nothing else passes.