오수빈

get location from index

......@@ -6,6 +6,7 @@ var logger = require('morgan');
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
//var categoryRouter = require('./routes/category');
var categoryRouter = require('./routes/category');
var app = express();
......
......@@ -44,4 +44,11 @@ router.get('/hospital', function (req, res) {
})
});
router.post('/', function(req, res){
//console.log("hello it's category");
var body = req.body;
var gu_select = body.user_gu;
console.log(gu_select);
});
module.exports = router;
\ No newline at end of file
......
......@@ -65,6 +65,14 @@
font-size: xx-large;
}
</style>
<script>
function sm() {
document.getElementById("location").submit();
}
</script>
</head>
<body>
......@@ -83,9 +91,13 @@
<p>
지역 선택
</p>
<select>
<form action="/category" method="post" name="location" id="location">
<select onchange="sm()" name="user_gu" id="user_gu_select">
<option value="">--Please choose an option--</option>
<option value='금천구'>금천구</option>
<option value='강남구'>강남구</option>
</select>
</form>
</div>
</div>
......