下面是解决方案:我在AngularJS/Node.JS中有一个表单,它从MongoDB中提取表单问题,并为每个答案分配值。我昨晚杀了我的MongoDB数据库。幸运的是,JSON文件仍然可用。使用JSON文件创建了两个新集合(与前一个数据库相同的名称),但当我试图完成表单并使用名为previous的数组将数据回发到数据库对象时,我得到了这个错误:
Error
at MongooseError.CastError ((HIDDEN)/node_modules/mongoose/lib/error/cast.js:18:16)
at ObjectId.cast ((HIDDEN)
描述:I有一个用于用户友好输入的表单:
但我不能以这种方式提交表单,因为我的表单操作模型如下:
public string Title { get; set; } // First input
public string Description { get; set; } // Second input
public string SportsmanId { get; set; } // Not used
public List<WorkoutExerciseParam> WorkoutExerciseParams { get; set;
为了动态地创建一个表单,我正在做一些类似的事情(在一个js函数中):
member = memberInfo.values[0];
// create the sign up form
var f = document.createElement("form");
f.setAttribute('method',"post");
f.setAttribute('name',"linkedInForm");
f.setAttribute('action', "users/register