We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38925
    • 38 Posts
    Hello,

    I'm trying to create my own TV (a file input) with this code :

    <input type="file" id="tv{$tv->id}" name="tv{$tv->id}">
    {if $tv->value}{$tv->value}{/if}
    <script type="text/javascript">
    // <![CDATA[
    {literal}
    MODx.load({
    {/literal}
        xtype: 'filefield'
        ,transform: 'tv{$tv->id}'
        ,id: 'tv{$tv->id}'
        ,width: 300
    {literal}
        ,listeners: { 'change': { fn:MODx.fireResourceFormChange, scope:this}}
    });
    {/literal}
    // ]]>
    </script>


    The field is generated, but when I've selected my file, the save button stays disable. Something is wrong with my listener ?

    Thanks !
      • 1778
      • 659 Posts
      Hello
      Try with " xtype: 'file' " instead of filefield...
      And maybe (not sure of that) add "fileUpload: true"
      Cheers [ed. note: anso last edited this post 14 years, 5 months ago.]
        • 38925
        • 38 Posts
        I try with and without fileUpload, file or filefield change nothing sad