mardi 5 novembre 2019

How to set a null value inside a drop-down selection without "parent_id" required

I would like to make a drop-down selection with the first selection comes with " NO PARENT ID REFERRED " and set as null value and pass into database in laravel

Here is my code ` Parent Category Please select one option

                    @foreach($parents as $parent)
                        @if ($parent-> status != 'Freeze')
                            <option value=""> </option>
                        @endif
                    @endforeach
                </select>
            </div>

            <div class="form-group">
                <label for="bit_app_policy_category_status">Status<span class="required">*</span></label>

                <select id="bit_app_policy_category_status"  name="status" class="form-control">
                    <option value="Active">Active</option>
                    <option value="Freeze">Freeze</option>
                </select>
            </div>

Dropdown selectionenter image description here`

Expected result = Please select one option -----No parent ID referred-----(able to choose and pass value into db) description 11 and so on .

Database be like

PLEASE NOTE THAT IM UNABLE TO USE FORM METHOD AS MY LRAVEL UNABLE TO UPDATE DUDE TO SPECIFIC PURPOSES



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire