Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Select gives no value

Chris77889 free 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 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

  • ForumUser: 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