I use this script to show an additional language menu additional, which works great however if the user selects a value then decided they don’t want to add an additional language an clicks “Remove” the form field is hidden however the value is still there and is submitted with the form.
Is there away to change the field value to when the user clicks the “remove” button or remove the field completely?
$(document).ready(function(){
//Hide div w/id extra
$(".smalla").hide();
$("#langadtional").hide();
$("#langadd").click(function(){
$("#langadtional").show();
});
$("#langrem").click(function(){
$("#langadtional").hide();
});
If you want to remove the element, use remove:
If you want to disable a form element:
To enable: