This is my first dig at node js forms. I am trying to use 
- https://github.com/caolan/forms/
I am trying to look up tables in database and make a form for each table 
and i am able to generate the form but I am unable to add div's to separate 
the different tables.

I have the right break point to get to the point of adding div's but I am 
unable to understand how to add this.

Here is the snippet ..

var forms = require('forms');
var myFields = forms.fields, myValidators = forms.validators, myWidgets = 
forms.widgets, myRenderers = forms.render;

                                    if (typeof Table.table_name != 'undefined' 
&& typeof Table.DATA_TYPE != 'undefined'){
                                            var type, renderer;
                                            if (Table.DATA_TYPE.match(/char/)){
                                                    type = 
myFields.string({required: true});
                                            }else 
if(Table.DATA_TYPE.match(/text/)){
                                                    type = myFields.string({ 
widget: myWidgets.textarea({rows: 6})});
                                            }else 
if(Table.DATA_TYPE.match(/int/)){
                                                    type = 
myFields.number({required: true});
                                            }
                                            //response.write('Type ' + type );

                                            if 
(profileTables.getIndex(Table.table_name) == -1 ){
                                                    
profileTables.push(Table.table_name);
                                                    /* I DONT KNOW HOW TO ADD 
<DIV> TAG HERE */
                                                    var divtag='({<div id=' + 
Table.table_name + '>})';
                                                    var 
rend=myFields.string(divtag);
                                                    renderer = 
myRenderers.div(Table.table_name,rend);
                                                    response.write('RENDERER ' 
+ renderer.toHTML);
                                                    jsonObject[renderer];
                                            }
                                            var column = Table.column_name;
                                            jsonObject[column]=type;

                      }

Appreciate any help on this.

   - Shekar
   - 

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to