How to populate data to textarea after I select the dropdown field, like a dependent field... please

How to populate data to textarea after I select the dropdown field, like a dependent field... please

stancaballerostancaballero Posts: 19Questions: 5Answers: 0

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Answers

  • stancaballerostancaballero Posts: 19Questions: 5Answers: 0

    If you help me solve this problem i will renew my account if needed

  • colincolin Posts: 14,448Questions: 1Answers: 2,462

    This example from this thread is doing that for a text field, using dependent() and field().set(), it would be the same for a textarea field. Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem.

    Cheers,

    Colin

  • stancaballerostancaballero Posts: 19Questions: 5Answers: 0

    This one after I selected Criteria [ACCED] field I want the details to populate in acced textarea next to it

  • colincolin Posts: 14,448Questions: 1Answers: 2,462

    Yep, understood - did you try what I suggested? What happened?

    Colin

  • stancaballerostancaballero Posts: 19Questions: 5Answers: 0

    editorAEF.dependent( ['tbl_cashmanagement_aef.criteria_acced'], function( val, data, callback, e ) {
    $.ajax( {
    url: '../datatables/controllers/cont_acced_list.php',
    data: {
    input1: editorAEF.field('tbl_cashmanagement_aef.criteria_acced').val()
    },
    success: function ( result ) {
    editorAEF.field('acced_details').set(result);
    //The problem here how to display the value only not the whole json data?
    }
    } );
    callback(true);
    } );

  • stancaballerostancaballero Posts: 19Questions: 5Answers: 0

    I got it now, Thank you. Another question colin may i know the additional features like we can now format the number in editor field, etc... coz i really love if you add that features

  • allanallan Posts: 56,837Questions: 1Answers: 9,034 Site admin

    What formatting would you like to apply to it? you can use a number input in the browser using:

    {
      label: 'My number',
      name: 'numberData',
      attr: {
        type: 'number'
      }
    }
    

    However hat won't format using decimal / thousands separators. For that you'd need to use a masked input such as with this plug-in.

    Allan

  • stancaballerostancaballero Posts: 19Questions: 5Answers: 0

    I mean after user input 1000 in editor field it automatically add comma like 1,000.00, I tried masked but I fail to control the input of the user.

  • stancaballerostancaballero Posts: 19Questions: 5Answers: 0

    And also the type: select in editor field allow the user to type so that he can search to the specific word/data in the selection. tnx

Sign In or Register to comment.