title: Node and PUG how to handle submit button in the code
body: <p>I am posting my code below. My question is how do I get the PUG submit button to work. Ultimately I want to return to the page but disable some of the selections. </p>
  
  <p>File app.js</p>
  
  <pre><code>var express = require('express');
  var bodyParser = require('body-parser');
  var path = require('path');
  var favicon = require('serve-favicon');
  var logger = require('morgan');
  var cookieParser = require('cookie-parser');
  
  
  var tedious = require('tedious');
  
  
  
  var routes = require('./routes/index');
  var users = require('./routes/users');
  
  var app = express();
  app.locals.moment = require('moment');
  
  // view engine setup
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'jade');
  
  // uncomment after placing your favicon in /public
  //app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
  app.use(logger('dev'));
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(cookieParser());
  app.use(express.static(path.join(__dirname, 'public')));
  
  app.use('/', routes);
  app.use('/users', users);
  
  // catch 404 and forward to error handler
  app.use(function(req, res, next) {
    var err = new Error('Not Found');
    err.status = 404;
    next(err);
  });
  
  // error handlers
  
  // development error handler
  // will print stacktrace
  if (app.get('env') === 'development') {
    app.use(function(err, req, res, next) {
      res.status(err.status || 500);
      res.render('error', {
        message: err.message,
        error: err
      });
    });
  }
  
  // production error handler
  // no stacktraces leaked to user
  app.use(function(err, req, res, next) {
    res.status(err.status || 500);
    res.render('error', {
      message: err.message,
      error: {}
    });
  });
  
  
  module.exports = app;
  </code></pre>
  
  <p>index.js</p>
  
  <pre><code>var express = require('express');
  var Promise = require('promise');
  
  var router = express.Router();
  var dataset = [];   
  
  router.get('/', getClients, function( req, res, next) {
  })
  router.post('/', function( req, res, next) {
      console.dir(req.body);
  });
  
  
  router.get('/helloworld', function(req, res) {
      res.render('helloworld', {title: 'Hello World'});
  
  });
  
  
  
  function getClients( req, res, next) {
      var promise = new Promise(function(fulfill, reject){
  
  
  
  
  
  
  
  
      var Connection = require('tedious').Connection;
      var Request = require('tedious').Request;
      var config = {
           server: '****',
           userName: '****',
           password: '****',
           options: {
                instanceName: '***'
           }
      };
  
  
  
  
      var connection = new Connection(config);
  
  
  
      connection.on('connect', function (err) {
              if (err) {
                console.log(err);
           } else {
                executeStatement();
           }
      });
      function clientRecord(id, Name)
      {
          this.id = id;
          this.Name = Name;
  
      }
      function executeStatement() {
  
         /*  var sql = "select people.people_id, evolv_cs.dbo.formatname(people.last_name, people.first_name, people.middle_name) as client " +
                " from  evolv_cs.dbo.people  join evolv_cs.dbo.event_log " +
                "on event_log.people_id = people.people_id " +
                " and event_log.event_definition_id = 'BA7EF74D-142D-4884-981A-6153755DFBE9' " + // program enrollment
                " and event_log.program_providing_service = '1D955DBF-529C-42D3-A2DA-C77B2036F642' " +   // Central Star PHF - Adolescent
                "  where   event_log.end_date is null "; */
  
          var sql = "select people_id, name as client from evolv_reports.dbo.people";
          console.log(sql);
           var Request = require('tedious').Request;
           request = new Request(sql, function (err, rowCount) {
                if (err) {
                     reject(err);
                } else {
                 if(rowCount &lt; 1) {
                     callback(null, false);
                 }
                 else {
                  fulfill(dataset);
                 }
                }
           });
  
  
           request.on('row', function (columns) {
               var id = ""
  
  
                columns.forEach(function (column) {
  
                    //console.log(column.metadata.colName);
                    if(column.metadata.colName=== "people_id"){
  
                        //console.log(column.value);
                        //dataset.push(column.value);
                        id = column.value;
                        //console.log(element);
                     //   col: column.metadata.colName,
                    //     val: column.value
                     }
                    if(column.metadata.colName==="client") {
                        var client = new clientRecord(id, column.value);
                        dataset.push(client);
  
                        console.log(client.id, client.Name);
                        client = null;
                    }
                });
  
  
  
  
  
  
           });
  
  
           request.on('doneProc', function (rowCount, more, returnStatus, rows) {
                next(null, rows);
                //res.json(dataset);
                //res.render();
                connection.close()
                //console.log(dataset);
                res.render('index', { title: 'Central Star PHF Clients. ' , dataset} );
                //console.log('zzz');
                dataset = [];
  
           });
           connection.execSql(request);
      }
      });
  
  }
  
  
  
  module.exports = router;
  </code></pre>
  
  <p>index.jade</p>
  
  <pre><code>extends layout
  //JSON.parse(dataset)
  
  
  rooms = [ 'Room1', 'Room2', 'Room3', 'Room4']
  
  block content
    h1= title
  
    h1 #{moment(Date.now()).format('dddd, MMMM Do YYYY: h:mm')}
  
  
    form(method='post', action='/')
      .input-group
        - each item in dataset
  
          //input#client(type='checkbox', name='#{item.id}', checked=False)
          //span #{item.Name}
          input.form-control(type='checkbox', placeholder='#{item.Name}', name='#{item.id}')
          span #{item.Name}
  
  
          p
  
  
    .form-group
      label Areas
      .radio
        label
          input#optionsRadios1(type="radio", name="optionsRadios", value="D")
          | DayRoom
      .radio
        label
          input#optionsRadios2(type="radio", name="optionsRadios", value="R")
          | BedRoom
      .radio
        label
          input#optionsRadios3(type="radio", name="optionsRadios", value="Y")
          | Yard
      .radio
        label
          input#optionsRadios3(type="radio", value="DA")
          | Dining Area     
     .form-group
  
  
  
  
  
  
      input.btn.btn-success(type='submit', value='Save')
  </code></pre>
  
  <p>The line I would like to see out put on is:
      router.post('/', function( req, res, next) {
          console.dir(req.body);</p>
  
  <p>My question boils down to why I don't see anything. From examples I have found on I have seen output. As may be apparent I am very new to this whole technology stack, including HTML, CSS ...</p>
  
  <p>This is what the page currently looks like
  <a href="https://i.stack.imgur.com/FWJ2e.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FWJ2e.jpg" alt="This is what the page looks like"></a></p>