Select gives no value


Topic: Select gives no value

Chris77889 asked 5 years ago

Hello,

I have a problem with the select elment in my forms.

I want to get the form data when i send the form. All fields except of my selects work. If i send the form i get empty values on the select fields. Is their any solution to solve it?

My select looks like:

<select id="project_warehouse" name="project[warehouse]" class="mdb-select md-form">
<option value="">Select Warehouse</option>
<option value="1">EC City</option>
<option value="2">EC City</option></select>

MDBootstrap staff pro premium priority answered 5 years ago

Hi Chris,

I see that you are using mdb-select element. After using js to initialize this component

// Material Select Initialization
$(document).ready(function() {
    $('.mdb-select').materialSelect();
});

we generate an input field that contains the selected value. You can check the value of this element by this function: $('.mdb-select.md-form input.select-dropdown').val();

I am here to help you.

Best Regards, Piotr


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.8.8
  • Device: PC
  • Browser: Firefox
  • OS: Windows 10 Pro
  • Provided sample code: No
  • Provided link: No