Submit MDB-select into the form


Topic: Submit MDB-select into the form

maxifom asked 8 years ago

The mdb-select didnt change the select itself, but only changes the UL and LI, so the Php $_POST didnt get anything, how to fix this issue?

Bartłomiej Malanowski staff pro premium answered 8 years ago

Hi, @maxifom! Could you please share your code? What do you get from var_dump($_POST);?

maxifom answered 8 years ago

I have this inside my form
<select class="mdb-select colorful-select dropdown-primary" name='select'>
    <option value="1">Option 1</option>
    <option value="2">Option 2</option>
    <option value="3">Option 3</option>
    <option value="4">Option 4</option>
    <option value="5">Option 5</option>
</select>
and get this from var_dump($_POST): {"name":"123","address":"123","description":"123","wh":"123","token":''}, so i dont even have it in my post

maxifom answered 8 years ago

If i comment all the other content, it works just fine.
<form action="" method='post'>
 <!--<div class="col-md-6 pb-3">
            <div class="md-form">
                <input type="text" name='name' id="form1" class="form-control">
                <label for="form1" class="">Name</label>
            </div>
 </div>
        
        <div class="col-md-6 pb-3">

            <div class="md-form">
                <input type="text" name='address' id="form2" class="form-control">
                <label for="form2" class="">Address</label>
            </div>

        </div>
        <div class="col-md-6 pb-3">

            <div class="md-form">
                <input type="text" name='description' id="form3" class="form-control">
                <label for="form3" class="">Description</label>
            </div>

        </div>
        <div class="col-md-6 pb-3">

            <div class="md-form">
                <input type="text" name='wh' id="form4" class="form-control">
                <label for="form4" class="">Working hours</label>
            </div>

        </div>
        <div class="col-md-6 pb-3">-->

            
<select class="mdb-select colorful-select dropdown-primary" name='select'>
    <option value="1">Option 1</option>
    <option value="2">Option 2</option>
    <option value="3">Option 3</option>
    <option value="4">Option 4</option>
    <option value="5">Option 5</option>
</select>
           

        </div>
            <button type='submit'>Submit</button>
            {{csrf_field()}}
</form>

Bartłomiej Malanowski staff pro premium answered 8 years ago

Do you use any PHP framework?
Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No