Forum OpenACS Development: Re: Forms X matrix input structure
How would I load up the other fields then?
For example, let's supose the user selects field1.0.
The form must be refreshed and the fields must be automatically filled. "Every row respectively"
field2.0 field3.0 field4.0 field5.0
I guess i have the knowledge about the pieces, however I still don't have a picture of "how" to accomplish the task.
To send data from your form to the db (without refreshing), execute an AJAX request with your favourite library to a Tcl file that saves the data to the db.
Don't use "onChange", instead use an Event Listener (google addEventListener).
Hope that helps.
Thank you guys for the feedback.
It helped a lot. I don't know how but it works! (sharing and writting about difficulties surprisingly open the mind. It makes you to look outsite the box.
I saw openacs lacks json interfaces. Its API is very poor. Isn't?
Am I correct?
You might be interested in the qf_ form API. It's made for scenarios like the one you have, with multiple arrays, dynamically declared forms and fields etc: