我有一个大的HTML形式,所以我决定用物化步进,以便于用户界面。 但形式没有按;吨提交给MySQL数据库。 我已经使用正常的形式投入少尝试,并将其提交到数据库。 我在想,是不是因为“UL”标记? 我的代码如下
HTML表格的片段:
<form class="CreateClient">
<ul class="stepper horizontal" style="min-height:550px">
<li class="step active">
<div class="step-title waves-effect waves-dark">Contact detail</div>
<div class="step-content">
<div class="row">
<div class="input-field col s12">
<i class="fa fa-user prefix"></i>
<input id="icon_prefix" type="text" class="first_name validate" required>
<label for="icon_prefix">First Name</label>
</div>
<div class="input-field col s12">
<i class="fa fa-user prefix"></i>
<input id="icon_prefix" type="text" class="surname validate" required>
<label for="icon_prefix">Surname</label>
</div>
<div class="input-field col s12">
<i class="material-icons prefix">place</i>
<input id="icon_place" type="text" class="address validate" required>
<label for="icon_place">Address</label>
</div>
<div class="input-field col s12">
<i class="material-icons prefix">local_post_office</i>
<input id="icon_post" type="number" class="post_code validate" required>
<label for="icon_post">Postcode</label>
</div>
<div class="input-field col s12">
<i class="material-icons prefix">phone</i>
<input id="icon_telephone" type="tel" class="telephone validate">
<label for="icon_telephone">Daytime Telephone</label>
</div>
<div class="input-field col s12">
<i class="material-icons prefix">phone_iphone</i>
<input id="icon_telephone" type="tel" class="mobile validate">
<label for="icon_phone_iphone">Mobile</label>
</div>
<div class="input-field col s12">
<i class="material-icons prefix">email</i>
<input id="icon_email" type="email" class="email validate">
<label for="icon_email">email</label>
</div>
</div>
<div class="step-actions">
<button class="waves-effect waves-dark btn" type="submit">Submit
<i class="material-icons right">send</i>
</button>
这是该节点的应用程序引用的类
const CreateClient = document.querySelector('.CreateClient')
CreateClient.addEventListener('submit', (e) => {e.preventDefault()
const firstName = CreateClient.querySelector('.first_name').value
const surname = CreateClient.querySelector('.surname').value
const address = CreateClient.querySelector('.address').value
const postCode = CreateClient.querySelector('.post_code').value
const telephone = CreateClient.querySelector('.telephone').value
const mobilePhone = CreateClient.querySelector('.mobile').value
const email = CreateClient.querySelector('.email').value
难道这些代码写得很好,是他们选择课程?如果不是与我用了插件的问题。 我很新的这一切。 请帮我