I really need to remove some block with the help of js. Is it possible not to hide some block, but remove it at all?
Because I have a field wich user will not be able to see if he selected "no" in my selectbox, but JQuery validation anyway sends message that this field is empty.
I have this:
$(function () {
$("#wichonepmtofollow").hide();
$("#particularpmselect").change(function () {
// find the selected one
var selectedCountry = $(this).val();
if (selectedCountry == "yes") {
$("#wichonepmtofollow").show();
}
// otherwise hide it
else {
$("#wichonepmtofollow").hide();
}
});
});
And this:
<div id="wichonepmtofollow">
<div class="section" id="inputdiv">
<span class="fieldname">Which one?</span>
<input type="text" id="wichonepm" name="wichonepm" title="can't be empty" class="required" minlength="1"/> <!-- Nessesary to be filled-->
<script type="text/javascript">
var wichonepm = new LiveValidation('wichonepm');
wichonepm.add(Validate.Presence);
</script>
</div>
<div id="clear"></div>
</div>
Like instead of $("#pleasespecify").hide(); make something like $("#pleasespecify").remove(); or something else?