I´m using Postman to automate some tests. I need to get the value of the value attribute on the hidden field with the name "execution":
<form class="app-form" method="post" id="fm1" action="login" _lpchecked="1">
<input type="hidden" name="execution" value="633ffc0f">
</form>
In postman, there´s only cheerio available for this. I´ve tried variations of the following, but none is working:
$('input#execution').attr("value");
$('input[name=execution]').attr("value");
$('input[type=hidden]').attr("value");
$(':hidden#execution').attr("value");
$('input:hidden[name=execution]').attr("value");
Many thanks!
input[name=execution]
does work fine for me
console.log($('input[type=hidden]').attr("value"));
console.log($('input[type=hidden]').val());
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<form class="app-form" method="post" id="fm1" action="login" _lpchecked="1">
<input type="hidden" name="execution" value="633ffc0f">
</form>
This is how you get value
const executionValue = $('input[name="execution"]').val();
console.log(executionValue);
https://jsfiddle.net/chille1987/3dap9yk4/2/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With