How not to select a particular form element?

Asked

Viewed 45 times

0

Hello, I wish my form didn’t select CAMPO_VALOR, but even using . not() it still returns a form with CAMPO_VALOR.

var $form = $("#frmParcelas");
var formSemCampoValor = $form.not('#CAMPO_VALOR');
console.log(formSemCampoValor);

Thanks in advance for your help.

  • 1

    Setting the disabled attribute in the value input field does not solve? disabled='disabled'.

1 answer

1


Hello, I hope the example below will help you, hugs.

<html>
<head>
<script src="js/jquery-1.11.2.min.js"></script>
</head>
<body>

<form id="frmParcelas">
    <input type="text" value="oi" id="oi"/>
    <input type="text" value="oie" id="oie"/>
    <input type="text" value="" id="deuruim"/>
</form>

    <script>
        var $form = $("#frmParcelas");
        var formSemCampoValor = $('input:not([value]),input[value=""]').css('border', 'solid 1px red');
    </script>

</body>
</html>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.