<select class="form-control"> <option>Loader</option> <option>Shopper</option> </select> I need it to disable this whole select class once I selected an option. Like the user can't select again once he/she selected once. Thank you!!
you can do it on the onchange event just like below:
<select class="form-control" id="select"> <option>Loader</option> <option>Shopper</option> </select> <script> $('#select').on('change', function() { $(this).attr('disabled', 'disabled') }); <script> this is the same code as @flint but for this to work you have define the jquery either from CDN(online url) or you can download the jquery and put it in your page in script tag.
This isn't a task for PHP. You'll need to use javascript and jquery would make it even easier.
<select class="form-control" id="select"> <option>Loader</option> <option>Shopper</option> </select> <script> $('#select').on('change', function() { $(this).attr('disabled', 'disabled') }); <script> id="select" as stated in this answer? Because the jQuery snippet is targetting via id, it will not work unless the id matchesf12 then locate console.