How to change input value of Form?

Hi. I want to make data loading text box.
There is one text box and datagrid.
If I click one cell of grid and click button, it throws cell’s value in alert window. (using javascript)

What I want to do is, get this value and write on the text box.
I made input text written by “p_rossi” when page load.

[code]formData = [
{type:“input”, label:“Login”, value:“p_rossi”}
]
myForm = new dhtmlXForm(“textboxObj”, formData);

[/code]

Then, how can I change this ‘value’ part after click grid cell?

Hi
You need to use method setFormData()

First set name for your input, i.e. gridCellValue

formData = [{type:"input", name: "gridCellValue", label:"Login", value:"p_rossi"}]

Then use method

form.setFormData( {"gridCellValue" : newValue //the value you will get from your script });

Thank you Darya! Quick and simple answer. It works perfectly :laughing:

You are welcome!