3.0.5

dynamically add a text box

the code is working properly, but the dynamically the text box and the command box is not added. Please help, this is an urgent need..

function draw_option( $top ) {
        echo "
        <script>
                draw_option_js(\"$top\");
        </script>\n";
}

function load_add_options_javascript() {

        echo "<script>
        var row_num=1;
        var new_top=0;

        function draw_option_js(top) {

                alert(top);

                var txt_left       = '75px';
                var txt_top        = top+'px';
                var txt_height     = '20px';
                var txt_width      = '50px';
                var txt_value      = '';
                var txt_type       = 'TEXT';
                var txt_validity   = 'NO-SPECIAL';

                var txt_id = new AW.HTML.INPUT;
                txt_id.setId ( 'txt_id_'+row_num );
                txt_id.setStyle ( 'position', 'absolute' );
                txt_id.setStyle ( 'top' , txt_top );
                txt_id.setStyle ( 'left' , txt_left );
                txt_id.setStyle ( 'height' , txt_height );
                txt_id.setStyle ( 'width' , txt_width );
                txt_id.setStyle ( 'border' , '#999' );
                txt_id.setAttribute( 'type' , txt_type );
                txt_id.setAttribute( 'value' , txt_value );
                txt_id.setStyle ( 'border','1px solid gray' );
                txt_id.setStyle ( 'color','navy' );
                page.push(txt_id);
                //alert(txt_id);

                var cmd_id = new AW.UI.Button;
                cmd_id.setId ( 'thres_add_'+row_num );
                cmd_id.setStyle ('top', txt_top);
                cmd_id.setStyle ('left', '135px');
                cmd_id.setStyle ('width', '50px');
                cmd_id.setControlText ('Add');
                cmd_id.setControlTooltip ('add option');

                new_top = parseInt(top)+parseInt(50);
                row_num = parseInt(row_num)+parseInt(1);

                cmd_id.setEvent ('onclick', 'draw_option_js ( new_top );' );
                page.push(cmd_id);
                //alert(cmd_id);
        }

        </script>\n";

}

echo "<script>
        var tabs = new Tab('tabs');
        var page = new Array();
</script>";
load_add_options_javascript();
draw_option($top_options['top']);
echo "<script>
 tabs.addPage('Testing',0,page);
 tabs.drawTabs();
</script>";


September 8,

This topic is archived.

See also:


Back to support forum