Template:ShowForm

    Table of contents
    No headers
    var inputs = $fields ?? [ ];
    var button = $button ?? 'Ok';
    var channel = $publish ?? 'default';
    <form>
        <table id=(@form)>
            foreach(var input in inputs where !input.hidden) {
                <tr>
                    <td> input.label ?? string.nbsp </td>
                    <td><input type="text" name=(input.field) value=(input.value) size=(input.size ?? 16)/></td>
                </tr>
            }
            <tr>
                <td>
                    foreach(var input in inputs where input.hidden) {
                        <input type="hidden" name=(input.field) value=(input.value)/>
                    }
                </td>
                <td align="right">
                    <input type="button" value=(button ?? 'Ok') ctor="when($this.click) {
                        var m = { };
                        Deki.$('#' + {{@form}}).find('input').each(function() { 
                            if(Deki.hasValue(this.name)) m[this.name] = Deki.$(this).val(); 
                        });
                        Deki.publish({{channel}}, m);
                    }"/>
                </td>
            </tr>
        </table>
    </form> 
    
    Tag page
    Viewing 2 of 2 comments: view all
    I modify this page, but i restore steveb version... but isn't working again yet :S
    Shame on me !
    anyway, i added some lines to allow select input types...
    http://developer.mindtouch.com/index.php?title=Template:ShowForm&action=diff&revision=6&diff=7 edited 07:12, 6 Aug 2009
    Posted 07:10, 6 Aug 2009
    @boldox the problem is that you don't have UNSAFECONTENT permission and thus can't save the page in a state where unsafe content can be executed. I re-saved it and it should be fine now.
    Posted 07:58, 6 Aug 2009
    Viewing 2 of 2 comments: view all
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by