Hi I’m using bunch of “multiline input” so that users can create their own courses. Two things:
How do I make anything written on “multiline input” be saved ? If it’s just a “input” then I know if I press enter, then it would change the value of the “input”. With “multiline input”, not sure how to do that.
How to leave the saved info on the page when user comes back. I want users to come back to the page occasionally whenever they have something to change, and I want all contents to stay there.
Multiline input functions the same as a standard input, so just use the same workflow you’d use for a standard input element.
Set the input’s ‘initial content’ to be the data from the database that you want to display - probably your input is inside a group, and that group will have a content type and a data source, so set the initial content to be the parent group’s ‘field you want to display’.
Thanks Adam for your reply. It still is not clear for me – so every time I press “enter” while typing in multilineinput, it will automatically save the data?
If you’re using ‘autobinding’ then you don’t need to press enter to save (it saves as the user types).
If you’re not using autobinding and you want to save the changes when a user presses enter, you need to run a workflow to make changes on the database when the input’s value is changed.
That applies to both standard and multiline inputs.
It pretty much resolved the problems, except that when I come back to the page / refresh it, it would not display any info because I couldn’t set up the specific data of ‘type’ of the page.
I want it to show a specific data of the ‘type’, so that when the user comes back, user will see their previous saved version of the page.
You probably don’t need to have a content-type for the page, unless you’re intending to have a an individual page for every camp in your database? If you’re displaying all your camps on pages on your site for example.
But even then you won’t be able to display camp data for a camp that doesn’t yet exist (as is the case in your example above).
Regardless, the simplest way to do it is by using the current user (assuming the user is linked in your database to the camp).
So just reference the ‘current user’s camp’ in your input’s initial content. (or better still, assuming the inputs are in a group, set the group’s content to the current user’s camp, and then set the input’s initial content to the parent group’s camp).