laravel | ajax,如果表单不完整发送电子邮件

时间:2018-03-15 08:09:33

标签: html css ajax laravel

Hello开发人员,

我正在尝试解决我遇到的问题,并且似乎无法找到正确的答案,可能的链接或解释将非常有用。

我想在输入电子邮件后在电子邮件字段中添加ajax函数,名称,姓氏和电子邮件应保存到数据库,而不会按下提交按钮。这样(完成您的表格)电子邮件可以在2小时后发送。

我对ajax很新,并且已经使用欧芹进行前端验证

有人能帮忙吗?

此致

{{ csrf_field() }}
<div class="form-group">
<label for="`name" class="name">First Name:</label>
<input type="text" name="name" id="name" class="form-control" required=" " 
data-parsley-minlength="6" data-parsley-trigger="blur">
</div>
<div class="form-group">
<label for="surname" class="surname">Surname:</label>
<input type="text" name="surname" id="surname" class="form-control" 
required=" " data-parsley-minlength="6" data-parsley-trigger="blur">
</div>

<div class="form-group">
<label for="email" class="email">Email Address:</label>
<input type="text" name="email" id="email" class="form-control" required=" " 
data-parsley-type="email" data-parsley-trigger="blur">
</div>
<div class="form-group">
<label for="`size" class="size">Size of company:</label>
<input type="text" name="size" id="size" class="form-control" required=" " 
data-parsley-type="integer" data-parsley-trigger="blur">
</div>
<div class="form-group">
<label for="`income" class="income">Income:</label>
<input type="text" name="income" id="income" class="form-control" required=" 
" data-parsley-type="integer" data-parsley-trigger="blur">
</div>
<div class="form-group" style="padding-bottom: 10px">
<label>Position in Company:</label>
<select name="position" id="position" class="form-control" value=" {{ 
old('position') }}" required=" " data-parsley-trigger="blur">
    @foreach(App\Http\Utilities\Position::all() as $position)
        <option value="{{ $position }}">{{ $position }}</option>
    @endforeach
</select>
</div>
<div class="form-group">
<textarea name="message" id="message" class="form-control" rows="4" data-
parsley-maxlength="1000" data-parsley-trigger="blur">Enter text here...
</textarea>
</div>
<div class="form-group">
<label for="path" class="path">Accept Terms and Conditions
<input type="checkbox" name="path" class="form-control" required=" " data-
parsley-trigger="blur"></label>
</div>
<div class="form-group">
<input type="file" class="form-control" name="cv" id="cv" data-parsley-
trigger="blur">
</div>
<button type="submit"class="btn btn-primary">Submit details</button>

0 个答案:

没有答案