Skip to content

Instantly share code, notes, and snippets.

@michelleboisson
Created February 29, 2012 15:20
Show Gist options
  • Save michelleboisson/1941514 to your computer and use it in GitHub Desktop.
Save michelleboisson/1941514 to your computer and use it in GitHub Desktop.
Selecting Options in dropdown menu from request.body
<form method="post">
<dl>
<% for(i=0; i<=itemTypes.length-1; i++) { %>
<dt><input type="checkbox" name="itemChoices" value="<%= itemTypes[i].itemTypeName %>"/> <strong><%= itemTypes[i].itemTypeName %></strong></dt>
<dd>Dominence Points: <%= itemTypes[i].domPts %><dd>
<dd>Picture: <%= itemTypes[i].picture %><dd>
<select>
<% for (r=rooms.length-1; r>=0; r--) { %>
<option value="<%= rooms[r].name %>"><%= rooms[r].name %></option>
<% } %>
</select>
<% } %>
</dl>
<input type="submit" value="Make Move" id="saveBtn"/>
</form>
app.post('/', function(request, response){
console.log("Inside app.post('/home')");
console.log("form received and includes")
console.log(request.body);
var itemChoices = request.body.itemChoices;
//var room : request.body.?????
console.log('itemChoices: ' + itemChoices);
response.redirect('/admin-player.html');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment