S
S
ss44v2020-06-02 14:31:14
Laravel
ss44v, 2020-06-02 14:31:14

How to set the input standard?

Guys there is this piece of code:

<!-- category_id -->
                    <?php $categoryIdError = (isset($errors) and $errors->has('category_id')) ? ' is-invalid' : ''; ?>
                    <div id="subCatBloc" class="form-group row required">
                      <label class="col-md-3 col-form-label{{ $categoryIdError }}">{{ t('Sub-Category') }} <sup>*</sup></label>
                      <div class="col-md-8">
                        <select name="category_id" id="categoryId" class="form-control selecter{{ $categoryIdError }}">
                          <option value="0"
                              @if (old('category_id')=='' or old('category_id')==0)
                                selected="selected"
                              @endif
                          > {{ t('Select a sub-category') }} </option>
                        </select>
                      </div>
                    </div>

                    <?php $titleError = (isset($errors) and $errors->has('title')) ? ' is-invalid' : ''; ?>
                    <div class="form-group row required">
                      <label class="col-md-3 col-form-label" for="title">{{ t('Title') }} <sup>*</sup></label>
                      <div class="col-md-8">
                        <input id="title" name="title" placeholder="{{ t('Job title') }}" class="form-control input-md{{ $titleError }}"
                             type="text" value="{{ old('title', $post->title) }}">
                        <small id="" class="form-text text-muted">
                          {{ t('A great title needs at least 60 characters.') }}
                        </small>
                      </div>
                    </div>


How to make it so that the
title is not written manually, but that it is organized from categories
, that is, the person selected the category, but did not write anything in the title (ideally hide)
and when the person clicks add, then the title is the name of the category.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question