I have a form where I can upload a file if I want:
<div class="form-group">
@Html.Label("Upload File", new { @class = "control-label col-md-2" })
<div class="col-md-10">
<input type="file" id="UploadedFile" name="upload" />
</div>
</div>
I want when a file was uploaded these fields to appear:
<div id="optionalFields">
<div class="form-group">
@Html.LabelFor(model => model.Field1, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Field1, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Field1, "", new { @class = "text-danger" })
</div>
</div>
//other fields
</div>
I think Javascript is needed but I don't know how to achieve this.