How can i save disabled dropdown in my database using POST. The reason why I need to used disable is to prevent user to change their selection.
When a user selects "Long neck (Emperador)", selection "pquantity will be disabled and input "pcs" will be shown
var pcs;
function checkOptions(select) {
pcs = document.getElementById('pcs');
if (select.options[select.selectedIndex].value == "Long neck (Emperador)") {
pcs.style.display = 'block';
document.getElementById('pquantity').disabled = true;
} else if (select.options[select.selectedIndex].value == "Gin (Bilog)") {
pcs.style.display = 'block';
document.getElementById('pquantity').disabled = true;
} else if (select.options[select.selectedIndex].value == "UFC Ketchup") {
pcs.style.display = 'block';
document.getElementById('pquantity').disabled = true;
} else {
document.getElementById('pquantity').disabled = false;
}
}
<select onchange="checkOptions(this)" name="pname" id="pname" class="form-control">
<option value="Aluminom Solid">Aluminum Solid</option>
<option value="Long neck (Emperador)">Long neck (Emperador)</option>
<option value="Gin (Bilog)">Gin (Bilog)</option>
<option value="UFC Ketchup">UFC Ketchup</option>
<option value="Bottle Caps">Bottle Caps</option>
<option value="Scrap Aluminum">Scrap Aluminum</option>
<option value="Scrap Iron">Scrap Iron</option>
<option value="Steel">Steel</option>
</select>
<select name="pquantity" id="pquantity" class="form-control">
<option value="">Please select quantity</option>
<option value="50">50 kls</option>
<option value="100">100 kls</option>
<option value="150">150 kls</option>
<option value="200">200 kls</option>
</select>
<input name="pcs" id="pcs" type="text" style="display: none" class="form-control" placeholder="Please indicate if how many pieces..." />