Here's my case:
I'm trying to get value from form's input that has name="data[type][answer]", something like:
<form id="form" method="POST" >
<input type="hidden" name="data[type][answer]" value="Hello from Space">
</form>
So, my code for function should look like:
function queryForm(key) {
return $('#form input[name=' + key + ']').val();
}
I'm getting input[name=order[type][answer]] which is not working and I'm aware why.
Is there a way how to write this thing differently or is there any other way how to get the value? By the way, I need the name exactly in this form: name="data[type][answer]"
Any advice or solution would be nice!
function queryForm(key) { return $('#form input[name=' + key + ']')[0].val(); }