/

 

The manual

Self-training

Experimentation

Contact

 

Language

Form for entering a comment

Here is the form used to post the comment, as seen by the user viewing the page:

as well as its view in detailed organize mode to understand how it is made:

Note that in the properties of the 'poster' button, we have set 'Additional action: Refresh the display' because, otherwise, the form created by the 'new_form' instruction will not be visible immediately, as well as 'Can be active in mode: All modes' so that the button can be activated without going into edit mode:

In addition, in the properties of the edit control, you must set 'Can be modified in mode: View or edit' as well as 'The control is: By user'.
Having one field per user allows two users to post a message at the same time without the message of one running the risk of overwriting that of the other.

Here is the content of the program:

if button_name="poster" 
  new_form "x/y/z" before form_id copy_fields
    field Str utilisateur ; field DateTime date
    utilisateur := user_name
    date := datetime
  commentaire := ""

This program reads as follows:
If the 'post' button has been pressed, we create a form by copying the form 'x / y / z' just above the current form, and we position its 'user' fields with the code of the user who pressed the 'post' button as well as the 'date' field with the current date and time.
Finally, we delete the 'comment' field in the initial form to prepare for entering a new comment.

Finally, here is the detailed organized mode view of the final form, the one which will be copied by the 'new_form' instruction of the program, and which we have designated by 'x / y / z' in the previous program:

Unlike the form which is used to post the message, in the final form, for all the fields we set the property 'Can be modified in mode: Never'.