html - Javascript input form -
i have datepicker function:
!!!5 html head link(type='text/css', href='http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css', rel='stylesheet') script(src='http://code.jquery.com/jquery-1.9.1.js', type='text/javascript') script(src='http://code.jquery.com/ui/1.10.3/jquery-ui.js', type='text/javascript') script $(function() { $.datepicker.setdefaults( $.extend($.datepicker.regional[""]) ); $("#datepicker").datepicker(); });
i want send result of chosen date input form.
input#datepicker(type='text')
i input field , can choose dates , forth, can't seem receive/transfer other .js file.
how can package result form (with value)? other values this:
form(action="/registeractivity", method="post") select(name = "item[activity]") each point in points option(value=point.activity) #{point.activity} select(name ="item[participant]") option(value='testvalue') option input#datepicker(type='text', name="item[date]") input(type="submit", value="registrer participant")
and received this:
registeractivity: function(req,res) { var item = req.body.item; newactivity = new activity(); newactivity.activityname = item.activity; newactivity.acitivtyparticipant = item.participant; newactivity.acitivtydate = item.date; newactivity.save(function savedactivity(err){ if(err) { throw err; } }); res.redirect('/');
any appreciated!
you're not showing entire code possible you're missing name attribute of it. that's req.body looks for.
so in jade be
input#datepicker(type='text', name='yourname')
Comments
Post a Comment