It sounds like you might just be stuck on the syntax for a form element. So assume your Brightness field has an ID tag of "myBrightness" you just get the node via the id and set the value property. Since you're using Prototype you can use this
Code: Select all
$("myBrightness").value = yourJsonObject.brightness;
There are also other ways to get to form elements via Javascript, something like "document.form[fieldname].value =" for one, but I tend to put unique ID tags on everythng to make my life easy.
[EDIT]
I am assuming your Ajax request is specifying a handler to process the JSON object once it comes back. Using the video example at around 4:30 you'll see that I'm in my handler
shell.CreateSampleData, inside the
if where I check that the JSON object isn't null, you'll see me using
syn.AddTextToCleanNodeViaId(). You should have something similar; you just want to use the above code for setting the field value instead of adding text to a node.
A couple of general pieces of advice.
jsfiddle can be very useful for messing around with snippets of javascript code.
Stackoverflow can get you answers to JavaScript questions within minutes. Make sure you search first, most programming questions in the known universe have already been asked and answered. If I don't find an answer from a search, I start asking the question, BUT, before I submit I look at all the suggestions for answers that StackOverflow provides. It's perfectly OK to ask your question here too, but you should expect slower response times.