我已经建立了一个系统,允许客户完成调查问卷。为了完成调查问卷,用户必须输入他们的唯一编号,该编号使用存储过程从不同的数据库中提取数据。
无论如何,我尝试做的是当客户完成他们的调查问卷并单击create id,就像要突出显示的单元格/字段集一样,这样我就可以知道哪个客户已经完成了调查问卷。
仍在改进我的前端开发,但需要一点帮助。我只发布了我的前端(视图)代码,因为那是需要完成工作的地方。
有人能用javascript/Jquery来指导我吗
<fieldset style="width:1200px;">
<legend>StoreQuestions</legend>
@Html.HiddenFor(model => model.storeId)
<div class="editor-label">
<h3>What condition was your Item in when you received it? (1 - Very Poor, 2 - Standard, 3 - Good , 4 - Excellent)</h3>
</div>
<input type="submit" value="Create" class="button">
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create(StoreQuestions storequestions)
{
if (ModelState.IsValid)
{
db.StoreQuestions.Add(storequestions);
db.SaveChanges();
return RedirectToAction("Details", "Questions", new { id = storequestions.QuestionsId });
}
return View(storequestions);
}发布于 2016-11-10 19:24:04
从来没有测试过代码,但是:
<fieldset style="width:1200px;">
<legend>StoreQuestions</legend>
@Html.HiddenFor(model => model.storeId)
<div class="editor-label" style='background-color:@(Model.id == theIdOfTheQuestion ? "blue" : "")'>
<h3>What condition was your Item in when you received it? (1 - Very Poor, 2 - Standard, 3 - Good , 4 - Excellent)</h3>
</div>
<input type="submit" value="Create" class="button">
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create(StoreQuestions storequestions)
{
if (ModelState.IsValid)
{
db.StoreQuestions.Add(storequestions);
db.SaveChanges();
return RedirectToAction("Details", "Questions", new { id = storequestions.QuestionsId });
}
return View(storequestions);
}您可以使用@foreach包装<div class="editor-label"..以生成问题,并从中获得theIdOfTheQuestion
https://stackoverflow.com/questions/40526160
复制相似问题