Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/417.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravael PHP,需要JavaScript帮助 首先,我是C、C++、C、Android和SWIFT的开发者,但我绝对没有JavaScript或PHP或Web开发的经验。_Javascript_Php_Laravel - Fatal编程技术网

Laravael PHP,需要JavaScript帮助 首先,我是C、C++、C、Android和SWIFT的开发者,但我绝对没有JavaScript或PHP或Web开发的经验。

Laravael PHP,需要JavaScript帮助 首先,我是C、C++、C、Android和SWIFT的开发者,但我绝对没有JavaScript或PHP或Web开发的经验。,javascript,php,laravel,Javascript,Php,Laravel,我为我的后端服务器买了一些源代码。这是一种我可以进入并储存产品的商店。现在,我已经完成了所有工作(即使web开发中的knowdlege为0),但是有一个文本输入字段可以检查整数值。我想像价格信息一样插入十进制值,例如19.99。然后它抱怨必须是19或20。我找不到更改该值的位置,也找不到负责检查输入值的类/函数。有一种叫做刀片的东西。在我看来,它是用HTML和javaScript编写的。我找不到任何类或到文件的路由,输入的值将被放入其中并进行检查。我甚至不知道哪个类/文件负责将值写入数据库。我是

我为我的后端服务器买了一些源代码。这是一种我可以进入并储存产品的商店。现在,我已经完成了所有工作(即使web开发中的knowdlege为0),但是有一个文本输入字段可以检查整数值。我想像价格信息一样插入十进制值,例如19.99。然后它抱怨必须是19或20。我找不到更改该值的位置,也找不到负责检查输入值的类/函数。有一种叫做刀片的东西。在我看来,它是用HTML和javaScript编写的。我找不到任何类或到文件的路由,输入的值将被放入其中并进行检查。我甚至不知道哪个类/文件负责将值写入数据库。我是说,wtf?找出哪个文件负责处理输入的值并不复杂。这让我发疯。

这是只接受整数值的输入

这是刀片代码:

{{-- resources/views/admin/dashboard.blade.php --}}
@extends('adminlte::page')

@section('title', 'Products')

@include('parts.header')

@section('content_header')
    <div class="col-md-12">
        <h2>Add new product</h2>
    </div>

@stop

@section('content')
    <div class="row">
        <div class="col-sm-12">
            <form method="post" action="{{ route('product.add') }}" enctype="multipart/form-data">
                {{ csrf_field() }}

                @if(!$errors->isEmpty())
                    <div class="alert alert-danger alert-dismissible">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                    <h4><i class="icon fa fa-ban"></i> Alert!</h4>
                        @foreach ($errors->all() as $error)
                            <div>{{ $error }}</div>
                        @endforeach
                     </div>
                @endif

            <div class="col-sm-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title">Details</h3>
                    </div>
                    <!-- /.box-header -->
                    <!-- form start -->
                    <form role="form">
                        <div class="box-body">
                            <div class="row">
                                <div class="col-sm-4 form-group ">
                                    <label for="name">Name</label>
                                    <input type="text" name="name" class="form-control" id="name" placeholder="Enter name" required>
                                </div>
                                <div class="col-sm-4 form-group ">
                                    <label for="name">Description</label>
                                    <input type="text" name="description" class="form-control" id="name" placeholder="Enter description" required>
                                </div>
                                <div class="col-sm-3 form-group ">
                                    <label for="category">Select category</label>
                                    <select name="category_id" class="form-control" required>
                                        <option value="" disabled selected>Select your option</option>
                                        @foreach($categories as $category)
                                            <option value="{{ $category->id }}">{{ $category->name }}</option>
                                        @endforeach
                                    </select>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-4 form-group">
                                    <label for="price">Price</label>
                                    <input type="number" name="price" class="form-control" id="price" placeholder="Enter price" required>
                                </div>
                                <div class="col-sm-4 form-group">
                                    <label for="amount">Amount</label>
                                    <input type="number" name="amount" class="form-control" id="amount" placeholder="Enter amount" required>
                                </div>
                                <div class="col-sm-3 form-group">
                                    <div class="row">
                                        <div class="col-sm-6">
                                            <img id="myImg" alt="" style="width: 100%;">
                                        </div>
                                        <div class="col-sm-6">
                                            <label for="image">Image</label>
                                            <input class="fullwidth input rqd" type="file" name="image" id="image" accept="image/*" onclick="fileClicked(event)" onchange="fileChanged(event)" required>
                                            <div id="log"></div>
                                        </div>
                                    </div>
                                </div>

                            </div>


                            <div class="row">
                                <div class="col-sm-6">
                                    <h4>Variations</h4>
                                    <div class="box-body table-responsive no-padding">
                                        <table id="variationTable" class="table table-bordered table-hover dataTable" role="grid">
                                            <thead>
                                            <tr role="row">
                                                <th rowspan="1" colspan="1">#</th>
                                                <th rowspan="1" colspan="1">Owner</th>
                                                <th rowspan="1" colspan="1">Remove</th>
                                            </tr>
                                            </thead>
                                            <tbody>

                                            <tr role="row" class="odd">
                                                <td>1</td>
                                                <td>
                                                    <input type="text" name="owner_id[]" placeholder="Enter owner" required>
                                                </td>
                                                <td>
                                                    <i class="fa fa-fw fa-remove"></i>
                                                </td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                    <button type="button" class="btn btn-default btn-sm addrow pull-right" style="height: 34px;">
                                        <span class="glyphicon glyphicon-plus-sign"></span> Add
                                    </button>
                                    <div class="clearfix"></div>

                                    <div>
                                        <button type="submit" class="btn btn-primary">Submit</button>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <h4>Siblings</h4>


                                    <div class="form-group">
                                        <select name="siblings[]" class="form-control select2" multiple>
                                            @foreach($products as $product)
                                                <option value="{{ $product->id }}">{{ $product->name }} </option>
                                            @endforeach
                                        </select>
                                    </div>


                                </div>
                            </div>
                        </div>
                        <!-- /.box-body -->
                    </form>
                </div>
            </div>
        </form>
    </div>
</div>
@stop



@section('js')
    @include('parts.footer');
@stop
{{--resources/views/admin/dashboard.blade.php-->
@扩展('adminlte::page')
@章节(“标题”、“产品”)
@包括('parts.header')
@节(“内容\标题”)
添加新产品
@停止
@节(“内容”)
{{csrf_field()}}
@如果(!$errors->isEmpty())
×
警觉的
@foreach($errors->all()作为$error)
{{$error}}
@endforeach
@恩迪夫
细节
名称
描述
选择类别
选择您的选项
@foreach($categories作为$category)
{{$category->name}
@endforeach
价格
数量
形象
变化
#
物主
去除
1.
添加
提交
兄弟姐妹
@foreach($products as$product)
{{$product->name}
@endforeach
@停止
@节('js')
@包括('parts.footer');
@停止
有人能告诉我在哪里找到处理输入的代码吗?在哪里可以找到检查整数的函数?我真的搜索了每一个文件,但不知怎么的,我太笨了,不适合那些网络内容

有一个类似于提到的类的东西:col-sm-4 form group,但我找不到它

谢谢<php? protected function validator(array $data) { return Validator::make($data, [ 'price' => 'required|string|min:19|max:20' ]); }