Fill text field with value from database

Fill text field with value from database

epep Posts: 24Questions: 6Answers: 0

I'm trying to transfer the functions of an old DOS database to datatables. A very nice feature of the DOS database is that one can choose a value from a specific database column to fill data into a text field of a new record.
See https://onedrive.live.com/redir?resid=BBB24FC87B783EA9!139&authkey=!ADWF3szFbvriBgQ&v=3&ithint=photo%2cpng

The function works like this
- When I want to fill in a certain text field I type some of the first letters of the text I want to fill in
- Then I press F2
- Then a window is opened which displays all values of the specific database column starting with these letters
- I can choose one of these values, and after pressing enter the complete value is copied to the text field I wanted to fill in.

My question is how I can implement something that works approximately like this in datatables.

Thanks,
Eberhard

Answers

  • allanallan Posts: 63,520Questions: 1Answers: 10,473 Site admin

    Hi Eberhard,

    If I've understood correctly, does this Editor example do what you need? You select a row and click the "duplicate" button which will pre-populate the fields based on the current row for the new entry.

    Allan

  • epep Posts: 24Questions: 6Answers: 0

    Hi Alan,

    thanks for your reply. Alas, "duplicate" does not exactly what I mean. "Duplicate" duplicates a complete row. What I need is something like a "cell-by-cell duplicate": In order to fill a specific column of a new data set, I would like to choose a value from the database in the same column of a different data set. For a second column of the new data set I would like to duplicate a value from the same column from another data set in turn.

    Hope that makes clearer what I mean.

    Eberhard

  • allanallan Posts: 63,520Questions: 1Answers: 10,473 Site admin

    Hi Eberhard,

    Sorry for my misunderstanding. To double check I've go tit right this time - you are basically looking for an auto complete? Type in an input field, a request is made to the server to get the options available and you can select one to complete the field? Rather like Google Suggest?

    If so, have a look at the Select2, Selectize and Chosen extensions for Editor (plug-ins page (you only need one, but there are serval available that basically do the same thing!). They are plug-ins to third party libraries which provide exactly this sort of ability.

    Regards,
    Allan

This discussion has been closed.