如何解决如何将sweetalert DOM节点值保存到数据库laravel中?
我想要一个甜蜜的警报输入(DOM 节点示例)来要求用户输入特定值。 然后我想将值保存到数据库中 PS:我正在与 Laravel 合作 这是我的 Sweetalert 代码
$(document).ready(function(){
$('.servipopupmsg').click(function(e){
var namefourn = $(this).find(".namefourn").text( );
e.preventDefault();
swal("are you sure you want to continue with "+namefourn+"? ",{
buttons: ["Cancel ","confirm "],}).then((result) => {
if( result){
console.log("User confirmed!" );
swal("Taper Matricule Camion:",{
content: "input",})
.then((value) => {
console.log("Value to check for valid matricule: "+ value );
//the code that i'm asking about to check if the input is valid(correct form
//if yes insert the input into the database
});
}else{
console.log( "User Not confirmed!" );
}
})
})
});
</script>
这就是我想要做的:
- 使用 Sweetalert DOM NODE 询问用户输入
- 接受输入并检查它是否有效
- 将输入添加到数据库的右列
我不确定我是否正确解释了这一点,但任何想法或建议将不胜感激。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。