Add custom button only in add form

Add custom button only in add form

dts1dts1 Posts: 22Questions: 0Answers: 0
edited April 2013 in Editor
Hi again !
Is it possible to add a custom button only in the add form ?
Example :
When I create a new entry, I want that user could generate a barcode when hits a button next to the barcode field. When he hits, on server side it loads last barcode from the datatbase and and generate the next barcode.
Thanks.

Replies

  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Two options:

    1. Use the show and hide methods ( http://editor.datatables.net/api/#show ) to add and remove the fields visually (but they will still be submitted).

    2. Use the add and clear methods ( http://editor.datatables.net/api/#add ) to dynamically add and remove the field if you don't want it to be submitted.

    You'd use events such as `onInitEdit` to know when to perform this actions.

    A third option is to use a different Editor instance for each button.

    Allan
This discussion has been closed.