以下 HTML:
<div class="form-inline">
<span>Name:</span>
<input id="name" type="text" class="form-control" placeholder="Name eingeben..." required/>
</div>
<div class="form-inline">
<span>Tierart:</span>
<input id="species" type="text" class="form-control" placeholder="Tierart eingeben..." required/>
</div>
<div class="form-inline">
<span>Rasse:</span>
<input id="breed" type="text" class="form-control" placeholder="Rasse eingeben..." required/>
</div>
<div class="form-inline">
<span>Chip-Nummer:</span>
<input id="chipnr" type="text" class="form-control" placeholder="Chip-Nummer eingeben..."/>
</div>
在脚本标签中,我将值放入字典中:
var data = {
name: $("#name").val(),
species: species.value,
breed: breed.value,
chipnr: chipnr.value
}
参加方式适用于其他字段,但不适用于名称字段,在字典中名称是“未定义”,为什么以及如何更改它?
摇曳的蔷薇
相关分类