in Editor, is it possible to show a field on Form (New) but not on the HTML ?

in Editor, is it possible to show a field on Form (New) but not on the HTML ?

yokowasisyokowasis Posts: 24Questions: 7Answers: 0
edited December 2020 in Free community support

I mean completely hidden, not just "not visible".

I want the user to be able to insert new data with sensitive field / information, and prefer not showing it to the html after he submit the form.

I try including the field in javascript, but skipping the field in the html. Datatable refused to load.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin

    Do you mean the hidden field type?

    Allan

  • yokowasisyokowasis Posts: 24Questions: 7Answers: 0

    No, hidden field is totally hidden even in the editor / form.

    I want it only hidden in the html table, but the user still be able to input the value trough new / edit form.

    Something like this :
    https://editor.datatables.net/examples/advanced/formOnlyData.html

    +

    https://datatables.net/extensions/buttons/examples/column_visibility/simple.html

    But when the user click "Column Visibility" button, it won't show the hidden column.

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    If I'm not mistaken, the first link you posted should be what you're after. If the field is defined in the Editor initialisation, but not in the DataTables columns list, then it won't be in the HTML or anywhere in the DOM.

    But given that you've seen that example, I suspect I'm missing something - if so, could you explain why that wouldn't work, please.

    Colin

  • yokowasisyokowasis Posts: 24Questions: 7Answers: 0

    If the field is defined in the editor initialisation, but not in the DataTables column list, The DataTables failed to Render.

    Unless I am missing something.

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    No, that's not the case. If you look at that example, age is only in the Editor initialisation, not DataTables, and the table still loads. The initialisation are entirely independent. and could even point to different scripts.

    Colin

  • yokowasisyokowasis Posts: 24Questions: 7Answers: 0

    Perhaps I am missing something, I will recheck my code. Thanks for the insight.

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    I think so, but please report back if you have no joy,

    Colin

This discussion has been closed.